-
Notifications
You must be signed in to change notification settings - Fork 0
87 lines (71 loc) · 2.44 KB
/
ci.yml
File metadata and controls
87 lines (71 loc) · 2.44 KB
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
types: [opened, synchronize, reopened, labeled]
permissions:
contents: read
jobs:
test:
if: >-
github.event_name == 'push' ||
github.event.action == 'opened' ||
contains(github.event.pull_request.labels.*.name, 'ok-to-test')
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: actions/setup-go@4a3601121dd01d1626a1e23e37211e3254c1c06c # v6.4.0
with:
go-version-file: go.mod
- name: Format check and vet
run: make check
- name: Lint (golangci-lint)
uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9.2.0
with:
version: v2.1
- name: Validate built-in rules
run: make validate-rules
- name: Verify rulepack signatures
run: |
PUBKEY=rulepacks/signing/rulepack-signing.pub.pem
FAIL=0
for sig in $(find rulepacks/campaigns -name '*.json.sig'); do
pack="${sig%.sig}"
if ! go run ./cmd/skeptic verify-rulepack --public-key "$PUBKEY" --rules-file "$pack"; then
echo "::error::Signature verification failed: $pack"
FAIL=1
fi
done
if [ "$FAIL" -eq 1 ]; then exit 1; fi
- name: Validate rulepack corpus tests
run: make validate-rulepacks
- name: Unit tests (race detector)
run: make test-race
- name: Integration tests
run: make integration
- name: Coverage gate
run: make coverage-check
- name: Benchmarks
run: make bench-save
- name: Upload benchmark results
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: skeptic-bench-${{ matrix.os }}
path: bench-results.txt
retention-days: 30
- name: Self-scan (SARIF)
if: always()
run: go run ./cmd/skeptic --path . --format sarif > skeptic-results.sarif 2>/dev/null || true
- name: Upload SARIF artifact
if: always()
uses: actions/upload-artifact@bbbca2ddaa5d8feaa63e36b76fdaad77386f024f # v7.0.0
with:
name: skeptic-sarif-${{ matrix.os }}
path: skeptic-results.sarif
retention-days: 30