Repository navigation
112 lines (103 loc) · 2.75 KB
/
Copy pathci.yml
File metadata and controls
112 lines (103 loc) · 2.75 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
name: CI
on:
push:
branches: [main]
pull_request:
# Least privilege for GITHUB_TOKEN: every job only checks out and reads the repo.
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: Lint & format
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- name: Prettier
run: npm run format:check
- name: ESLint
run: npm run lint
build:
name: Type check & build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run build
test:
name: Unit tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
- run: npm run test
integration:
name: Integration tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
# The main process runs the real Python sidecar.
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv sync --frozen --directory python
- run: npm run test:integration
e2e:
name: E2E tests
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .nvmrc
cache: npm
- run: npm ci
# Saving a project runs the Python sidecar's policy compiler.
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv sync --frozen --directory python
# Ubuntu 24.04's AppArmor blocks the unprivileged user namespaces Chromium's sandbox needs.
- run: sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
- run: xvfb-run -a npm run test:e2e
- if: failure()
uses: actions/upload-artifact@v7
with:
name: e2e-results
path: |
playwright-report/
test-results/
retention-days: 7
backend:
name: Python backend
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: astral-sh/setup-uv@v7
with:
enable-cache: true
- run: uv sync --frozen --directory python
- name: Black
run: uv run --no-sync --directory python black --check .
- name: Pytest
run: uv run --no-sync --directory python pytest