-
Notifications
You must be signed in to change notification settings - Fork 64
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Disable staticcheck in golangci and add explicit staticcheck on diffe…
…rent platforms with merge.
- Loading branch information
1 parent
a147b69
commit 6cc0298
Showing
1 changed file
with
52 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -18,3 +18,55 @@ jobs: | |
with: | ||
version: latest | ||
only-new-issues: true | ||
args: --disable staticcheck | ||
|
||
golangci-pr-staticcheck: | ||
name: "Run staticcheck CI" | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
os: ["windows-latest", "ubuntu-latest", "macOS-latest"] | ||
go: ["1.19"] | ||
runs-on: ${{ matrix.os }} | ||
steps: | ||
- uses: actions/checkout@v1 | ||
with: | ||
fetch-depth: 1 | ||
- uses: WillAbides/[email protected] | ||
with: | ||
go-version: ${{ matrix.go }} | ||
- uses: dominikh/[email protected] | ||
with: | ||
version: "2023.1.6" | ||
min-go-version: "module" | ||
install-go: false | ||
cache-key: ${{ matrix.go }} | ||
output-format: binary | ||
output-file: "./staticcheck.bin" | ||
- uses: actions/upload-artifact@v3 | ||
with: | ||
name: "staticcheck-${{ github.sha }}-${{ matrix.go }}-${{ matrix.os }}.bin" | ||
path: "./staticcheck.bin" | ||
retention-days: 1 | ||
if-no-files-found: warn | ||
output: | ||
name: "Output Staticcheck findings" | ||
needs: golangci-pr-staticcheck | ||
runs-on: "ubuntu-latest" | ||
steps: | ||
- uses: WillAbides/[email protected] | ||
with: | ||
go-version: "1.22.x" | ||
# this downloads all artifacts of the current workflow into the current working directory, creating one directory per artifact | ||
- uses: actions/download-artifact@v3 | ||
- id: glob | ||
run: | | ||
# We replace newlines with %0A, which GitHub apparently magically turns back into newlines | ||
out=$(ls -1 ./staticcheck-*.bin/*.bin) | ||
echo "::set-output name=files::${out//$'\n'/%0A}" | ||
- uses: dominikh/[email protected] | ||
with: | ||
version: "2023.1.6" | ||
min-go-version: "module" | ||
install-go: false | ||
merge-files: ${{ steps.glob.outputs.files }} |