Skip to content

Commit c8ec231

Browse files
martinkuncdlevy-msft-sql
authored andcommitted
Disable staticcheck in golangci and add explicit staticcheck on different platforms with merge.
1 parent a4b9662 commit c8ec231

1 file changed

Lines changed: 52 additions & 0 deletions

File tree

.github/workflows/golangci-lint.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,3 +24,55 @@ jobs:
2424
with:
2525
version: latest
2626
only-new-issues: true
27+
args: --disable staticcheck
28+
29+
golangci-pr-staticcheck:
30+
name: "Run staticcheck CI"
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
35+
go: ["1.19"]
36+
runs-on: ${{ matrix.os }}
37+
steps:
38+
- uses: actions/checkout@v1
39+
with:
40+
fetch-depth: 1
41+
- uses: WillAbides/setup-go-faster@v1.12.0
42+
with:
43+
go-version: ${{ matrix.go }}
44+
- uses: dominikh/staticcheck-action@v1.3.0
45+
with:
46+
version: "2023.1.6"
47+
min-go-version: "module"
48+
install-go: false
49+
cache-key: ${{ matrix.go }}
50+
output-format: binary
51+
output-file: "./staticcheck.bin"
52+
- uses: actions/upload-artifact@v3
53+
with:
54+
name: "staticcheck-${{ github.sha }}-${{ matrix.go }}-${{ matrix.os }}.bin"
55+
path: "./staticcheck.bin"
56+
retention-days: 1
57+
if-no-files-found: warn
58+
output:
59+
name: "Output Staticcheck findings"
60+
needs: golangci-pr-staticcheck
61+
runs-on: "ubuntu-latest"
62+
steps:
63+
- uses: WillAbides/setup-go-faster@v1.12.0
64+
with:
65+
go-version: "1.22.x"
66+
# this downloads all artifacts of the current workflow into the current working directory, creating one directory per artifact
67+
- uses: actions/download-artifact@v3
68+
- id: glob
69+
run: |
70+
# We replace newlines with %0A, which GitHub apparently magically turns back into newlines
71+
out=$(ls -1 ./staticcheck-*.bin/*.bin)
72+
echo "::set-output name=files::${out//$'\n'/%0A}"
73+
- uses: dominikh/staticcheck-action@v1.3.0
74+
with:
75+
version: "2023.1.6"
76+
min-go-version: "module"
77+
install-go: false
78+
merge-files: ${{ steps.glob.outputs.files }}

0 commit comments

Comments
 (0)