Repository navigation
59 lines (46 loc) · 1.62 KB
/
Copy pathci.yml
File metadata and controls
59 lines (46 loc) · 1.62 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
name: CI
# Quality gate: formatting, lint, types, audit, tests with coverage thresholds and
# a production build. Defined ONCE and consumed from two directions:
# - pull_request — gates every PR
# - workflow_call — build-push.yml runs this same gate before publishing an image
# (this also covers direct pushes to master, so there is no push trigger here)
on:
pull_request:
workflow_call:
permissions:
contents: read
# A new push to the same PR cancels the superseded run instead of queueing behind it.
# (When called from build-push.yml the caller's concurrency group applies instead.)
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
quality:
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Node
uses: actions/setup-node@v4
with:
node-version: 24
cache: npm
- name: Install dependencies
run: npm ci
# Fails on known high/critical advisories reachable from production deps.
# Dev-only advisories are left to Dependabot so a toolchain CVE cannot block
# an unrelated deploy.
- name: Audit dependencies
run: npm audit --omit=dev --audit-level=high
- name: Check formatting
run: npm run format:check
- name: Lint
run: npm run lint
- name: Typecheck
run: npm run typecheck
# `coverage` = vitest run --coverage; enforces the thresholds from vite.config.ts.
- name: Test (with coverage thresholds)
run: npm run coverage
- name: Build
run: npm run build