-
-
Notifications
You must be signed in to change notification settings - Fork 269
Expand file tree
/
Copy pathlefthook.yml
More file actions
89 lines (87 loc) · 3.79 KB
/
Copy pathlefthook.yml
File metadata and controls
89 lines (87 loc) · 3.79 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
pre-commit:
parallel: true
jobs:
- group: # Backend checks
parallel: false
jobs:
- name: Run lint check on backend files
run: uv run ruff check --fix .
stage_fixed: true
- name: Run format check on backend files
run: uv run ruff format .
stage_fixed: true
- name: Check UV lockfile consistency
run: uv lock --check
- group: # Client checks
parallel: false
jobs:
- name: Run lint check on client files
root: "client/"
run: ./node_modules/.bin/eslint --fix . # Hardcoded path because Windows messes up if we use npx
stage_fixed: true
- name: Run format check on client files
root: "client/"
run: ./node_modules/.bin/prettier --write .
stage_fixed: true
- group: # Client v2 checks
parallel: false
jobs:
- name: Run lint check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/eslint --fix . # Hardcoded path because Windows messes up if we use npx
stage_fixed: true
- name: Run format check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/prettier --write .
stage_fixed: true
- name: Run type check on client_v2 files
root: "client_v2/"
# Both prerequisites are gitignored generated code, absent on a fresh
# clone: paraglide compiles $lib/paraglide (normally done by the vite
# plugin, so a non-build check never triggers it), and svelte-kit sync
# generates .svelte-kit/tsconfig.json. npm run keeps the paraglide
# flags in package.json only, so they can't drift from vite.config.ts.
run: npm run paraglide && ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
# Same as pre-commit but no fixes
ci:
parallel: true
jobs:
- group: # Backend checks
parallel: false
jobs:
- name: Run lint check on backend files
run: uv run ruff check .
- name: Run format check on backend files
run: uv run ruff format --check .
- name: Check UV lockfile consistency
run: uv lock --check
- name: Run backend unit tests
run: uv run pytest tests
- group: # Client checks
parallel: false
jobs:
- name: Run lint check on client files
root: "client/"
run: ./node_modules/.bin/eslint . # Hardcoded path because Windows messes up if we use npx
- name: Run format check on client files
root: "client/"
run: ./node_modules/.bin/prettier --check .
- group: # Client v2 checks
parallel: false
jobs:
- name: Run lint check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/eslint . # Hardcoded path because Windows messes up if we use npx
- name: Run format check on client_v2 files
root: "client_v2/"
run: ./node_modules/.bin/prettier --check .
- name: Run type check on client_v2 files
root: "client_v2/"
# See the pre-commit copy of this job for why paraglide runs first.
run: npm run paraglide && ./node_modules/.bin/svelte-kit sync && ./node_modules/.bin/svelte-check --tsconfig ./tsconfig.json
- name: Run unit tests on client_v2 files
root: "client_v2/"
# Mirrors the backend's pytest job above. Kept to the ci hook only, so
# committing stays fast; these are pure unit tests over src/**/*.test.ts,
# not the browser suite in tests_frontend_v2/.
run: ./node_modules/.bin/vitest run