Skip to content

Commit

Permalink
github actions: improve actions for go1.17
Browse files Browse the repository at this point in the history
  • Loading branch information
maruel committed Dec 13, 2021
1 parent 9d7265d commit 8cb20f1
Showing 1 changed file with 13 additions and 21 deletions.
34 changes: 13 additions & 21 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,18 @@ jobs:
key: "${{runner.os}}-gopkg-${{hashFiles('go.sum', '.github/workflows/*.yml')}}"

# Fetch the tools before checking out, so they don't modify go.mod/go.sum.
- name: 'go get necessary tools'
run: >
cd ..;
go get -u -v
github.com/gordonklaus/ineffassign
github.com/securego/gosec/cmd/gosec
golang.org/x/lint/golint
golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow
honnef.co/go/tools/cmd/staticcheck
- name: 'go get necessary tools (ubuntu)'
- name: 'go install necessary tools'
run: |
go install -v github.com/gordonklaus/ineffassign@latest
go install -v github.com/securego/gosec/cmd/gosec@latest
go install -v golang.org/x/lint/golint@latest
go install -v golang.org/x/tools/go/analysis/passes/shadow/cmd/shadow@latest
go install -v honnef.co/go/tools/cmd/staticcheck@latest
- name: 'go install necessary tools (ubuntu)'
if: always() && matrix.os == 'ubuntu-latest'
run: >
cd ..;
go get -u -v
github.com/client9/misspell/cmd/misspell
github.com/google/addlicense
run: |
go install -v github.com/client9/misspell/cmd/misspell@latest
go install -v github.com/google/addlicense@latest
# Now run proper checks.
- name: 'Check: go vet'
Expand Down Expand Up @@ -166,10 +162,6 @@ jobs:
- name: "Check: go generate doesn't modify files"
run: |
go generate ./...
# TODO(maruel): Due to https://github.com/golang/go/issues/40276, ignore
# go.mod/go.sum modifications. Remove once a new Go toolchain fixes
# this.
git checkout HEAD -- go.mod go.sum
# Also test for untracked files.
TOUCHED=$(git status --porcelain --ignored)
if ! test -z "$TOUCHED"; then
Expand All @@ -192,7 +184,7 @@ jobs:
# Force an upgrade to test devices with tip of tree host.
run: |
cd ..
git clone https://github.com/periph/devices
git clone --depth 1 https://github.com/periph/devices
cd devices
go mod edit -replace=periph.io/x/host/v3=../host
go get -t ./...
Expand All @@ -202,7 +194,7 @@ jobs:
# Force an upgrade to test cmd with tip of tree host.
run: |
cd ..
git clone https://github.com/periph/cmd
git clone --depth 1 https://github.com/periph/cmd
cd cmd
go mod edit -replace=periph.io/x/host/v3=../host
go get -t ./...
Expand Down

0 comments on commit 8cb20f1

Please sign in to comment.