forked from ChelseaKR/queer-the-stacks
-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (107 loc) · 4.92 KB
/
Copy pathci.yml
File metadata and controls
128 lines (107 loc) · 4.92 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
name: ci
# Mirrors QUALITY-AND-METRICS-STANDARD §"enforcement pipeline". Every stage
# below is merge-blocking *within this workflow* (no `|| true`/continue-on-error
# on any gate). `make verify` runs the same stages locally.
#
# The repository `protect-main` ruleset requires this workflow's `verify` job
# and the standards job before merge. The workflow remains self-contained for
# forked pull requests and receives only read access to repository contents.
on:
push:
branches: [main]
pull_request:
branches: [main]
permissions:
contents: read
# Cancel superseded runs on the same ref — PRs and main alike; a newer push
# always carries its own full run (CI-CD-STANDARD §11c).
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
verify:
name: verify
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4
with:
persist-credentials: false
- name: Set up Python
uses: actions/setup-python@a26af69be951a213d495a4c3e4e4022e16d87065 # v5
with:
python-version: "3.14"
- name: Set up Node (for the pa11y/axe a11y runner)
uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4
with:
node-version: "20"
- name: Set up uv (pinned)
uses: astral-sh/setup-uv@d31148d669074a8d0a63714ba94f3201e7020bc3 # v8.3.0
with:
version: "0.11.26"
enable-cache: true # CI job only — release.yml keeps caching off (§8c)
# `--frozen` fails the build on any drift between pyproject.toml and the
# committed uv.lock, instead of silently re-resolving (CQ-09, SEC-13).
- name: Install project (dev + app extras, locked)
run: |
uv sync --frozen --extra dev --extra app
npm install -g pa11y@9.1.1
# Pinned, checksum-verified gitleaks binary (no GitHub Action / license
# needed — a plain binary on PATH is exactly what scripts/secret-scan.sh
# already looks for, so the single-entry-point `make security` design and
# local/CI parity are unchanged). Bump both the URL and the checksum
# together when upgrading.
- name: Install gitleaks (pinned v8.30.1, checksum-verified)
run: |
set -euo pipefail
curl -sSL -o /tmp/gitleaks.tar.gz \
https://github.com/gitleaks/gitleaks/releases/download/v8.30.1/gitleaks_8.30.1_linux_x64.tar.gz
echo "551f6fc83ea457d62a0d98237cbad105af8d557003051f41f3e7ca7b3f2470eb /tmp/gitleaks.tar.gz" | sha256sum -c -
tar -xzf /tmp/gitleaks.tar.gz -C /tmp gitleaks
sudo install -m 0755 /tmp/gitleaks /usr/local/bin/gitleaks
gitleaks version
# Pinned, checksum-verified osv-scanner binary — scans uv.lock for known
# advisories against every locked (not just installed) version (SEC-13).
- name: Install osv-scanner (pinned v2.4.0, checksum-verified)
run: |
set -euo pipefail
curl -sSL -o /tmp/osv-scanner \
https://github.com/google/osv-scanner/releases/download/v2.4.0/osv-scanner_linux_amd64
echo "15314940c10d26af9c6649f150b8a47c1262e8fc7e17b1d1029b0e479e8ed8a0 /tmp/osv-scanner" | sha256sum -c -
sudo install -m 0755 /tmp/osv-scanner /usr/local/bin/osv-scanner
osv-scanner --version
# `uv sync` created .venv above, which is the Makefile's own PYTHON
# default — no PYTHON= override needed for these targets.
# 1. format + lint (ruff, incl. bandit SAST subset)
- name: Lint
run: make lint
# 2. strict type-check
- name: Type-check
run: make typecheck
# 3. unit + integration tests + coverage gate (>=85%)
- name: Tests
run: make test
# 4. dependency vulnerability scan (installed env) + lockfile CVE scan
# (osv-scanner against uv.lock) + secret scan (all merge-blocking).
# `make security` runs pip-audit, scripts/secret-scan.sh (finds the
# gitleaks binary installed above — no grep fallback in CI), and
# osv-scanner (installed above) — no GitHub API calls or repository
# secrets are needed, so the same gate runs on forked pull requests.
- name: Security (deps + lockfile + secrets)
run: make security
# 5. accessibility — dashboard + login, structural and Chromium/axe,
# desktop/mobile/light/dark plus asserted 320px reflow — all blocking.
- name: Accessibility
run: make a11y
# 7. responsible-tech: offline eval must beat the popularity baseline
- name: Eval
run: make eval
- name: Performance load smoke
run: make perf-load
- name: Lighthouse CI
run: make lighthouse
- name: Upload audit artifacts
if: always()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4
with:
name: audit-artifacts
path: docs/audits/