-
-
Notifications
You must be signed in to change notification settings - Fork 1
160 lines (137 loc) · 5.37 KB
/
Copy pathci.yml
File metadata and controls
160 lines (137 loc) · 5.37 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
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
name: CI
on:
pull_request:
branches: [main, master]
types: [opened, edited, synchronize, reopened]
push:
branches: [main, master]
jobs:
# ===========================================================================
# Path detection (shared with Test Suite)
# ===========================================================================
changes:
name: Detect changes
uses: ./.github/workflows/detect-changes.yml
# ===========================================================================
# PR Title Lint (conventional commits)
# ===========================================================================
pr-title:
name: PR Title
if: github.event_name == 'pull_request'
runs-on: ubuntu-latest
steps:
- uses: amannn/action-semantic-pull-request@v6
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
types: |
feat
fix
refactor
perf
docs
test
ci
build
chore
requireScope: false
subjectPattern: ^.+$
subjectPatternError: "PR title must have a description after the type prefix"
# ===========================================================================
# Frontend Lint & Build
# Always runs: this job name is a required status check. When there are no
# frontend-relevant paths, report success without installing or linting.
# ===========================================================================
frontend-ci:
name: Frontend Lint & Build
needs: changes
runs-on: ubuntu-latest
steps:
- name: Skip frontend CI (no relevant changes)
if: needs.changes.outputs.frontend != 'true'
run: |
echo "No frontend-relevant paths changed; skipping Frontend Lint & Build."
{
echo "### Frontend Lint & Build"
echo
echo "Skipped — no frontend-relevant changes."
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/checkout@v7
if: needs.changes.outputs.frontend == 'true'
- uses: actions/setup-node@v7
if: needs.changes.outputs.frontend == 'true'
with:
node-version: '22'
cache: 'npm'
cache-dependency-path: 'frontend/package-lock.json'
- name: Install dependencies
if: needs.changes.outputs.frontend == 'true'
working-directory: frontend
run: npm ci
- name: Lint
if: needs.changes.outputs.frontend == 'true'
working-directory: frontend
run: npm run lint
- name: Format check
if: needs.changes.outputs.frontend == 'true'
working-directory: frontend
run: npm run format:check
- name: Typecheck
if: needs.changes.outputs.frontend == 'true'
working-directory: frontend
run: npm run typecheck
- name: Build
if: needs.changes.outputs.frontend == 'true'
working-directory: frontend
run: npm run build
# ===========================================================================
# Backend Lint
# Always runs: this job name is a required status check. When there are no
# backend-relevant paths, report success without installing or linting.
# ===========================================================================
backend-lint:
name: Backend Lint
needs: changes
runs-on: ubuntu-latest
steps:
- name: Skip backend lint (no relevant changes)
if: needs.changes.outputs.backend != 'true'
run: |
echo "No backend-relevant paths changed; skipping Backend Lint."
{
echo "### Backend Lint"
echo
echo "Skipped — no backend-relevant changes."
} >> "$GITHUB_STEP_SUMMARY"
- uses: actions/checkout@v7
if: needs.changes.outputs.backend == 'true'
- name: Set up Python 3.11
if: needs.changes.outputs.backend == 'true'
uses: actions/setup-python@v7
with:
python-version: "3.11"
# Pin to match uv.lock / ruff-pre-commit rev so local hooks and CI agree.
- name: Install linting tools
if: needs.changes.outputs.backend == 'true'
run: pip install "ruff==0.15.7"
- name: Run ruff linter
if: needs.changes.outputs.backend == 'true'
run: ruff check comicarr/ --output-format=github
- name: Run modern backend quality ratchet
if: needs.changes.outputs.backend == 'true'
run: python scripts/run_ruff.py modern
# Deleting a module-level global cannot make its reassignment fail, so
# the only gate against GLOBAL_MESSAGES coming back is a source scan.
- name: Check retired globals stay retired
if: needs.changes.outputs.backend == 'true'
run: python scripts/check_retired_globals.py
- name: Run ruff formatter check
if: needs.changes.outputs.backend == 'true'
run: ruff format --check comicarr/
# The generated TypeScript is a backend artifact — its input is the config
# registry, so drift is caused by a Python edit and belongs in this job.
# The generator loads registry.py by path and needs no project deps, so
# this runs on the ruff-only install above.
- name: Check generated settings types are fresh
if: needs.changes.outputs.backend == 'true'
run: python scripts/generate_config_types.py --check