Repository navigation
140 lines (138 loc) · 5.15 KB
/
Copy pathtest.yml
File metadata and controls
140 lines (138 loc) · 5.15 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
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
name: Reliability tests
on:
push:
pull_request:
workflow_call:
permissions:
contents: read
jobs:
cache:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install migration CLI
run: go install -tags postgres github.com/golang-migrate/migrate/v4/cmd/[email protected]
- name: Cache clocks, invalidation races, cancellation and pool bounds
run: go test -race -shuffle=on -count=1 ./test/cache ./test/task ./test/telemetry
- name: Real isolated Redis and PostgreSQL fault and session regression
run: make test-cache
postgres:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Install migration CLI
run: go install -tags postgres github.com/golang-migrate/migrate/v4/cmd/[email protected]
- name: Check sqlc generation consistency
run: |
go install github.com/sqlc-dev/sqlc/cmd/[email protected]
sqlc generate
git diff --exit-code -- internal/db/sqlc
test -z "$(git ls-files --others --exclude-standard -- internal/db/sqlc)"
- name: Discord command registration safety
run: python3 -m unittest discover -s test/python -p "test_register_discord_commands.py" -v
- name: CD safety regression tests
run: |
python3 -m unittest discover -s test/python -p "test_deploy_release.py" -v
python3 -m unittest discover -s test/python -p "test_prepare_monitoring.py" -v
python3 -m unittest discover -s test/python -p "test_init_cache.py" -v
python3 -m unittest discover -s test/python -p "test_prepare_cache.py" -v
python3 -m unittest discover -s test/python -p "test_apply_cache.py" -v
- name: Load runner safety contracts (offline)
run: python3 -m unittest discover -s test/load/unit -p "test_*.py" -v
- name: Unit tests and static checks
run: |
test -z "$(gofmt -l cmd internal test)"
go vet ./cmd/... ./internal/... ./test/...
go test ./cmd/... ./internal/... ./test/...
- name: Go dependency vulnerability scan
run: |
go install golang.org/x/vuln/cmd/[email protected]
govulncheck ./internal/... ./cmd/...
- name: Three isolated database rounds with race detector
run: python3 scripts/test_integration.py --repeat 3
- uses: actions/upload-artifact@v4
if: always()
with:
name: go-coverage
path: artifacts/lesson21/
if-no-files-found: ignore
browser-flow:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Prepare browser and frontend
working-directory: frontend
run: |
npm ci
npx playwright install --with-deps chromium
npm run build
- name: Install migration CLI
run: go install -tags postgres github.com/golang-migrate/migrate/v4/cmd/[email protected]
- name: Browser through real API and isolated Discord stub
run: python3 scripts/test_integration.py --repeat 1 --browser-e2e
frontend-security:
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
cache-dependency-path: frontend/package-lock.json
- name: Audit and validate frontend
working-directory: frontend
run: |
npm ci
npm audit --audit-level=high
npm run api:check
npm run lint
npm run typecheck
npm test
npm run build
- name: Load workload contracts (offline)
run: node --test test/load/unit/workload.test.mjs
container-smoke:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@v4
- name: Generate disposable local test credentials and certificates
run: python3 scripts/init_local_stack.py
- name: Build pinned multi-stage images
run: docker compose -f compose.production.yaml build --pull
- name: Verify migration gate and persistent container stack
run: python3 -m test.python.test_local_stack
- uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Pull pinned monitoring images and check rules
run: |
docker compose -f compose.monitoring.yaml pull
python3 scripts/check_monitoring_rules.py
- name: Monitoring and isolated deployment failure drills
run: |
python3 -m test.python.test_monitoring
- uses: actions/upload-artifact@v4
if: always()
with:
name: container-image-sizes
path: artifacts/lesson23/images.json
if-no-files-found: ignore