Skip to content

Commit

Permalink
Force golangci-lint to run on every supported Os (elastic#234)
Browse files Browse the repository at this point in the history
* Force golangci-lint to run on every supported Os

By default `golangci-lint` will run the linters for the current running
platform and will only include the files for this platform. Using the `GOOS`
environment variable and a matrix defined in the github action we force
the linter to try all the supported operating system.
  • Loading branch information
ph authored Mar 23, 2022
1 parent 2c4c5ee commit 2bc00a9
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,9 +12,20 @@ permissions:
pull-requests: read
jobs:
golangci:
strategy:
matrix:
include:
- GOOS: windows
- GOOS: linux
- GOOS: darwin
name: lint
runs-on: ubuntu-latest
steps:
- name: Echo details
env:
GOOS: ${{ matrix.GOOS }}
run: echo Go GOOS=$GOOS

- uses: actions/checkout@v2

# Uses Go version from the repository.
Expand All @@ -27,6 +38,8 @@ jobs:
go-version: "${{ steps.goversion.outputs.version }}"

- name: golangci-lint
env:
GOOS: ${{ matrix.GOOS }}
uses: golangci/golangci-lint-action@v2
with:
# Optional: version of golangci-lint to use in form of v1.2 or v1.2.3 or `latest` to use the latest version
Expand Down

0 comments on commit 2bc00a9

Please sign in to comment.