-
Notifications
You must be signed in to change notification settings - Fork 0
90 lines (82 loc) · 2.9 KB
/
ci.yml
File metadata and controls
90 lines (82 loc) · 2.9 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
88
89
90
name: CI
on:
push:
branches: [main, master]
pull_request:
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Test (Unit, Snapshot, and E2E)
env:
TERM: xterm-256color
run: |
go test -race -count=1 -v -coverprofile=coverage.out -covermode=atomic ./...
go tool cover -func=coverage.out | grep total
- name: Build
env:
CGO_ENABLED: "0"
run: go build -o /tmp/drover-code ./cmd/drover-code
- name: Upload coverage artefact
uses: actions/upload-artifact@v4
with:
name: coverage-${{ github.run_id }}
path: coverage.out
retention-days: 7
quality-gate:
name: Quality Gate (CRAP)
runs-on: ubuntu-latest
needs: test
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download coverage artefact
uses: actions/download-artifact@v4
with:
name: coverage-${{ github.run_id }}
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Run quality gate
run: |
python3 scripts/quality-gate.py . \
--coverage coverage.out \
--limit 10000
fuzz:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Fuzz (30s per target)
env:
CGO_ENABLED: "0"
run: |
set -e
run_fuzz() {
echo "== $1 =="
# -timeout must exceed -fuzztime so the coordinator can stop workers
# cleanly (avoids "context deadline exceeded" on some platforms).
go test -timeout=120s ./"$2" -fuzz="$3" -fuzztime=30s -fuzzminimizetime=5s
}
run_fuzz api internal/api FuzzStreamNext
run_fuzz safepath internal/tools/toolutil FuzzSafePath
run_fuzz extractJSON internal/coordinator FuzzExtractJSON
run_fuzz parseWebhook internal/github FuzzParseWebhook
run_fuzz extractMention internal/github FuzzExtractMention
run_fuzz mergeInto internal/config FuzzMergeInto
run_fuzz parseCLIFlags cmd/drover-code FuzzParseCLIFlags
run_fuzz convo internal/convo FuzzConvoManager
run_fuzz registryExecute internal/tools FuzzRegistryExecute
run_fuzz undercoverDomain internal/undercover FuzzIsInternalDomain
run_fuzz tuiPermPrompt internal/tui FuzzModel_permissionPromptKeys
run_fuzz tuiPermBatch internal/tui FuzzModel_permissionBatchKeys
run_fuzz parseExecStream internal/tools/ukc FuzzParseExecStream
run_fuzz templateExpander internal/commands FuzzTemplateExpander
run_fuzz parseMarkdownCmd internal/commands FuzzParseMarkdownCommand