Skip to content

Commit 050e8e8

Browse files
committed
ci: add CI workflow to validate frontend build and backend deps
Add a minimal least-privilege CI workflow (contents: read) that validates the dependency bumps in this branch: - node: npm ci + lint + next build (typecheck) on Node 20.x/22.x - python: pip install -r requirements.txt + compileall api scripts (3.11) - audit: non-blocking npm audit advisory job Uses actions/checkout@v4, setup-node@v4 (npm cache), setup-python@v5 (pip cache), with a cancel-in-progress concurrency group.
1 parent 3deb41d commit 050e8e8

1 file changed

Lines changed: 63 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 63 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
8+
permissions:
9+
contents: read
10+
11+
concurrency:
12+
group: ci-${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: true
14+
15+
jobs:
16+
node:
17+
name: Frontend (Next.js)
18+
runs-on: ubuntu-latest
19+
strategy:
20+
fail-fast: false
21+
matrix:
22+
node-version: ['20.x', '22.x']
23+
steps:
24+
- uses: actions/checkout@v4
25+
- uses: actions/setup-node@v4
26+
with:
27+
node-version: ${{ matrix.node-version }}
28+
cache: npm
29+
- name: Install dependencies
30+
run: npm ci
31+
- name: Lint
32+
run: npm run lint
33+
- name: Build
34+
run: npm run build
35+
36+
python:
37+
name: Backend (FastAPI)
38+
runs-on: ubuntu-latest
39+
steps:
40+
- uses: actions/checkout@v4
41+
- uses: actions/setup-python@v5
42+
with:
43+
python-version: '3.11'
44+
cache: pip
45+
- name: Install dependencies
46+
run: |
47+
python -m pip install --upgrade pip
48+
pip install -r requirements.txt
49+
- name: Byte-compile sources
50+
run: python -m compileall api scripts
51+
52+
audit:
53+
name: Dependency audit (advisory)
54+
runs-on: ubuntu-latest
55+
continue-on-error: true
56+
steps:
57+
- uses: actions/checkout@v4
58+
- uses: actions/setup-node@v4
59+
with:
60+
node-version: '22.x'
61+
cache: npm
62+
- name: npm audit
63+
run: npm audit --audit-level=high

0 commit comments

Comments
 (0)