-
-
Notifications
You must be signed in to change notification settings - Fork 377
57 lines (56 loc) · 1.74 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
name: "CI"
on: ["push", "pull_request"]
jobs:
ci:
name: "Run CI"
strategy:
fail-fast: false
matrix:
os: ["windows-latest", "ubuntu-latest", "macOS-latest"]
go: ["1.22.x"]
godebug: ["gotypesalias=0", "gotypesalias=1"]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v1
with:
fetch-depth: 1
- uses: WillAbides/[email protected]
with:
go-version: ${{ matrix.go }}
- run: "go test ./..."
env:
GODEBUG: ${{ matrix.godebug }}
- run: "go vet ./..."
- uses: dominikh/staticcheck-action@v1
with:
version: "2023.1.7"
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: ci
runs-on: "ubuntu-latest"
steps:
- uses: WillAbides/[email protected]
with:
go-version: "stable"
# 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/staticcheck-action@v1
with:
install-go: false
merge-files: ${{ steps.glob.outputs.files }}