From ac75958d2eaf4891f80674a4e478f1ad377ddf8c Mon Sep 17 00:00:00 2001 From: Josh Bleecher Snyder Date: Mon, 3 May 2021 10:55:49 -0700 Subject: [PATCH] workflows: run staticcheck on more platforms To prevent issues like #1786, run staticcheck on the primary GOOSes: linux, mac, and windows. Windows also has a fair amount of GOARCH-specific code. If we ever have GOARCH staticcheck failures on other GOOSes, we can expand the test matrix further. This requires installing the staticcheck binary so that we can execute it with different GOOSes. Signed-off-by: Josh Bleecher Snyder --- .github/workflows/staticcheck.yml | 20 ++++++++++++++++---- 1 file changed, 16 insertions(+), 4 deletions(-) diff --git a/.github/workflows/staticcheck.yml b/.github/workflows/staticcheck.yml index 4ffe1b34b..607e035dd 100644 --- a/.github/workflows/staticcheck.yml +++ b/.github/workflows/staticcheck.yml @@ -24,11 +24,23 @@ jobs: - name: Run go vet run: go vet ./... - - name: Print staticcheck version - run: go run honnef.co/go/tools/cmd/staticcheck -version + - name: Install staticcheck + run: "GOBIN=~/.local/bin go install honnef.co/go/tools/cmd/staticcheck" - - name: Run staticcheck - run: "go run honnef.co/go/tools/cmd/staticcheck -- $(go list ./... | grep -v tempfork)" + - name: Print staticcheck version + run: "staticcheck -version" + + - name: Run staticcheck (linux/amd64) + run: "GOOS=linux GOARCH=amd64 staticcheck -- $(go list ./... | grep -v tempfork)" + + - name: Run staticcheck (darwin/amd64) + run: "GOOS=darwin GOARCH=amd64 staticcheck -- $(go list ./... | grep -v tempfork)" + + - name: Run staticcheck (windows/amd64) + run: "GOOS=windows GOARCH=amd64 staticcheck -- $(go list ./... | grep -v tempfork)" + + - name: Run staticcheck (windows/386) + run: "GOOS=windows GOARCH=386 staticcheck -- $(go list ./... | grep -v tempfork)" - uses: k0kubun/action-slack@v2.0.0 with: