From 101081cd59f65f18b84dd4f6608b5747f9e9c64b Mon Sep 17 00:00:00 2001 From: Svilen Kanev Date: Tue, 2 Nov 2021 14:46:29 -0700 Subject: [PATCH 1/2] ci: Disable staticcheck on tip-of-tree compiler. staticcheck only supports the latest 2 copmiler releases. Fixes #662. --- .github/workflows/ci.yaml | 4 ++++ test.sh | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 9b433c80c2..84f6825aa9 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,6 +50,8 @@ jobs: - name: Update Go version manually if: matrix.go == 'tip' working-directory: ${{ github.workspace }} + env: + RUN_STATICCHECK: false run: | git clone https://go.googlesource.com/go $HOME/gotip cd $HOME/gotip/src @@ -116,6 +118,8 @@ jobs: - name: Update Go version manually if: matrix.go == 'tip' + env: + RUN_STATICCHECK: false working-directory: ${{ github.workspace }} run: | git clone https://go.googlesource.com/go $HOME/gotip diff --git a/test.sh b/test.sh index 50b6524499..0ecb53aa08 100755 --- a/test.sh +++ b/test.sh @@ -23,7 +23,9 @@ echo "mode: $MODE" > coverage.txt # All packages. PKG=$(go list ./...) -staticcheck $PKG +if [ "$RUN_STATICCHECK" != "false" ]; then + staticcheck $PKG +fi # Packages that have any tests. PKG=$(go list -f '{{if .TestGoFiles}} {{.ImportPath}} {{end}}' ./...) From 86d63d3c7ad130ee83ff98f6aeafcd7d35a712ea Mon Sep 17 00:00:00 2001 From: Svilen Kanev Date: Tue, 2 Nov 2021 15:19:50 -0700 Subject: [PATCH 2/2] Set RUN_STATICCHCECK for subsequent steps. --- .github/workflows/ci.yaml | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 84f6825aa9..396a383049 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -50,13 +50,12 @@ jobs: - name: Update Go version manually if: matrix.go == 'tip' working-directory: ${{ github.workspace }} - env: - RUN_STATICCHECK: false run: | git clone https://go.googlesource.com/go $HOME/gotip cd $HOME/gotip/src ./make.bash echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV + echo "RUN_STATICCHECK=false" >> $GITHUB_ENV echo "$HOME/gotip/bin:$PATH" >> $GITHUB_PATH - name: Checkout the repo @@ -118,14 +117,13 @@ jobs: - name: Update Go version manually if: matrix.go == 'tip' - env: - RUN_STATICCHECK: false working-directory: ${{ github.workspace }} run: | git clone https://go.googlesource.com/go $HOME/gotip cd $HOME/gotip/src ./make.bash echo "GOROOT=$HOME/gotip" >> $GITHUB_ENV + echo "RUN_STATICCHECK=false" >> $GITHUB_ENV echo "$HOME/gotip/bin" >> $GITHUB_PATH - name: Checkout the repo