Repository navigation
162 lines (132 loc) · 6.09 KB
/
Copy pathci.yml
File metadata and controls
162 lines (132 loc) · 6.09 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
161
162
name: CI
on:
push:
branches: [main]
pull_request:
branches: [main]
jobs:
test:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
# Single Python version (not a matrix) — CI runs the declared floor,
# 3.11 (pyproject requires-python >=3.11), so the minimum-supported
# version is the one actually tested. The code uses no version-specific
# features, so testing the floor covers the pinned dev version too.
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- uses: actions/setup-node@v4
with:
node-version: "20"
# Match `just setup-linux` (.[dev,uinput,dbus]) so the pyright typecheck
# resolves the daemon's optional-backend imports (dbus_fast, evdev).
# Installing only .[dev] leaves those extras absent and every
# dbus_fast/evdev import reads as reportMissingImports — the CI/local
# drift the [tool.pyright] note in pyproject.toml warns about.
- name: Install Python deps
run: pip install -e ".[dev,uinput,dbus]"
# `npm ci` (not `npm install`) so the runner resolves the exact
# versions in client/package-lock.json — a resolver drift in CI is
# the opposite of the deterministic ladder #77 asks for.
- name: Install client deps
run: npm ci
working-directory: client
# Each step is named so a failure points at the subsystem
# (#77 — "failures identify the relevant subsystem and remediation
# rather than only returning a generic nonzero result"). The
# recipe these mirror is `just test-all`; run it locally to
# reproduce a CI failure. Keep the ubuntu `test` job and `just
# test-all` in lockstep: same steps, same order, same numbering.
# (The macOS / Nix / 3.12 jobs below are CI-only.)
- name: "[1/8] pyright daemon (Python typecheck)"
run: |
pip install pyright
pyright --pythonpath "$(command -v python)" daemon
- name: "[2/8] pytest (Python unit + integration)"
run: pytest
# The GNOME extension and KWin script are the upstream half of the
# focus wire protocol; these pure-node contracts guard the producer
# shape and parser reconciliation without a compositor (#130). They
# also run under `just test` locally.
- name: "[3/8] focus-wire contracts (GNOME + KWin producers)"
run: |
node scripts/test_focus_wire_shape.mjs
node scripts/test_kwin_focus_bridge.mjs
- name: "[4/8] tsc --noEmit (TypeScript typecheck)"
run: npx tsc --noEmit
working-directory: client
- name: "[5/8] vitest unit (client unit tests)"
run: npm run test:unit
working-directory: client
# Build the client before e2e — playwright serves client/dist, so
# any TypeScript change in client/src must be bundled for the
# browser to pick it up.
- name: "[6/8] playwright e2e (client end-to-end)"
run: |
# No nix store on the runner, so find-chromium.mjs returns undefined
# and Playwright falls back to its own managed browser — which must
# be installed first (with system libs). Without this the launch
# fails with "Executable doesn't exist … chrome-headless-shell".
npx playwright install --with-deps chromium
npm run build
npm run test:e2e
working-directory: client
- name: "[7/8] smoke (daemon end-to-end via stable fixture #77)"
run: python -u scripts/smoke.py
- name: "[8/8] eslint (client lint)"
run: npm run lint
working-directory: client
# macOS carries no uinput/evdev, so the full suite (which imports the
# Linux input path) can't run here. But the macOS *backend* is pure —
# platform_macos and the platform-parity drift-guard only read
# advertised capability flags, never PyObjC/Quartz — so run exactly
# those two files on a real Mac. This is what actually exercises the
# macOS column of docs/PLATFORM-PARITY.md from a macOS runner (#136);
# on ubuntu the same assertion passes but on the host's Python only.
#
# The full ladder (lint / tsc / vitest / smoke) is exercised on the
# ubuntu job above. macOS here is host-safe (no input devices, no
# desktop required) per #77 AC "CI covers the macOS platform path
# without requiring physical macOS input devices" — the parity test
# reads advertised capability flags only.
test-macos:
runs-on: macos-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.11"
- run: pip install -e ".[dev]"
- name: "[macOS] platform-parity + macOS backend"
run: pytest -v tests/test_platform_parity.py tests/test_platform_macos.py
# Nix packaging: builds packages.deckd + the focus-watcher bundles,
# evaluates the NixOS/home-manager modules against dummy configs,
# unit-tests the activation scripts in a sandbox, and boots the packaged
# daemon on loopback (health, bundled client, bundled decks). Mirrors
# `just nix-check` locally; see nix/tests/.
nix:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: cachix/install-nix-action@v31
- name: "[nix] flake check (packages + module evals + smoke)"
run: nix flake check -L
# The Nix package ships Python 3.12 (nixos-unstable's 3.11 package set
# can't build our dependency closure), so test the interpreter users
# actually get on NixOS. The 3.11 floor is covered by the main `test`
# job above; this job is the behavioural half of the 3.12 story.
test-py312:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: "3.12"
# Match the main job's extras so optional-backend imports resolve.
- name: Install Python deps
run: pip install -e ".[dev,uinput,dbus]"
- name: "[py3.12] pytest (Python unit + integration)"
run: pytest
- name: "[py3.12] smoke (daemon end-to-end via stable fixture #77)"
run: python -u scripts/smoke.py