-
Notifications
You must be signed in to change notification settings - Fork 0
108 lines (102 loc) · 3.23 KB
/
Copy pathci.yml
File metadata and controls
108 lines (102 loc) · 3.23 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
name: CI
# Validate every push to master and every PR: the engine must build + pass its
# tests, and the UI (including the WASM build it depends on) must type-check and
# build. These checks already exist locally — this runs them automatically.
on:
push:
branches: [master]
pull_request:
# Restrict the GITHUB_TOKEN to the minimum required.
# All jobs here only read code and run tests — no writes needed.
permissions:
contents: read
jobs:
engine:
name: Engine — build + test
runs-on: ubuntu-latest
defaults:
run:
working-directory: engine
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
# chronos-wasm is built via wasm-pack in the `ui` job; here we build/test
# the host-native crates where the real test suites live.
- run: cargo fmt --all --check
- run: cargo clippy -p chronos-core -p chronos-server --locked -- -D warnings
- run: cargo build -p chronos-core -p chronos-server --locked
- run: cargo test -p chronos-core --locked
- run: cargo test -p chronos-server --locked
world-data:
name: World data — schema validation
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-python@v7
with:
python-version: '3.12'
- run: pip install jsonschema
- run: python scripts/validate_worlds.py
ui:
name: UI — wasm + typecheck + build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: dtolnay/rust-toolchain@stable
with:
targets: wasm32-unknown-unknown
- uses: Swatinem/rust-cache@v2
with:
workspaces: engine
- uses: jetli/wasm-pack-action@v0.4.0
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: ui/package-lock.json
- run: npm ci
working-directory: ui
- run: npm run build:wasm
working-directory: ui
- run: wasm-pack test --node engine/chronos-wasm
- run: npm test
working-directory: ui
# `npm run build` is `tsc && vite build` — type-check + production bundle.
- run: npm run build
working-directory: ui
# Upload the dist + wasm so the e2e job can serve it without rebuilding.
- uses: actions/upload-artifact@v7
with:
name: ui-dist
path: ui/dist
retention-days: 1
e2e:
name: UI — Playwright E2E
needs: ui
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version: 22
cache: npm
cache-dependency-path: ui/package-lock.json
- run: npm ci
working-directory: ui
- uses: actions/download-artifact@v8
with:
name: ui-dist
path: ui/dist
- run: npx playwright install --with-deps chromium
working-directory: ui
- run: npm run e2e
working-directory: ui
- uses: actions/upload-artifact@v7
if: failure()
with:
name: playwright-report
path: ui/playwright-report
retention-days: 7