From 4d03e3f68b0f5c1d83396a1e3457c750e66c6a4c Mon Sep 17 00:00:00 2001 From: Marc-Antoine Ruel Date: Mon, 13 Dec 2021 10:32:48 -0500 Subject: [PATCH] github actions: update go get to go install for go1.17 --- .github/workflows/test.yml | 32 ++++++++++++-------------------- 1 file changed, 12 insertions(+), 20 deletions(-) diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 30edfad..dfc8bf7 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -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' @@ -165,10 +161,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 @@ -191,7 +183,7 @@ jobs: # Force an upgrade to test cmd with tip of tree devices. 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/devices/v3=../devices go get -t ./...