Skip to content

Disable staticcheck in golangci and add explicit staticcheck on different platforms with merge. #531

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
52 changes: 52 additions & 0 deletions .github/workflows/golangci-lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Loading