Repository navigation
186 lines (182 loc) · 6.66 KB
/
Copy pathci.yml
File metadata and controls
186 lines (182 loc) · 6.66 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
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
permissions:
contents: read
defaults:
run:
shell: bash
jobs:
# The checks, the differential tests, and from what those tests ran, the compatibility proof
# (tests/compat.py). The proof must reproduce in CI within five minutes, which the timeout holds it to.
check:
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 5
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 30
env:
ZERO_SERVER_PG: postgresql://postgres:postgres@localhost:5432
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
# The differential tests run the published @rocicorp/zero package as their oracle.
- run: npm ci
working-directory: harness
- run: uv sync --locked --group e2e
- run: uv run ruff check
- run: uv run ruff format --check
- run: uv run ty check
- run: uv run pytest
- run: uv run python -m tests.compat
- if: failure()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: compat-coverage
if-no-files-found: ignore
path: |
harness/build/c8/
harness/runner.log
# The suite again with every direct dependency at the lowest version pyproject.toml allows, so a floor
# is never lower than what has been tested.
floors:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 30
env:
ZERO_SERVER_PG: postgresql://postgres:postgres@localhost:5432
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
- run: npm ci
working-directory: harness
- run: uv sync --resolution lowest-direct
- run: uv run --no-sync pytest --no-cov
# An unmodified Zero client syncing through zero-cache, once with the TypeScript reference app server
# and once with the Python one. Fails on any difference in what the client ends up with.
e2e:
runs-on: blacksmith-4vcpu-ubuntu-2404
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
- run: npm ci
working-directory: e2e
- run: uv sync --locked --group e2e
- run: uv run --group e2e python -u e2e/run.py
- if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: e2e-logs
path: e2e/build/
# The CPU-only benchmarks, Python (bench/test_cpu.py) and TypeScript (harness/bench/cpu.ts), under
# CodSpeed's CPU simulation. Instruction counts do not depend on runner load, so CodSpeed's check on
# the pull request flags a regression without tolerances.
codspeed:
runs-on: ubuntu-latest
timeout-minutes: 8
permissions:
contents: read
id-token: write
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
cache: npm
cache-dependency-path: harness/package-lock.json
- run: npm ci
working-directory: harness
- run: uv sync --locked
- uses: CodSpeedHQ/action@821a40cd6c80e3cfe387caf55668287addd808da # v5.5.0
with:
mode: simulation
run: uv run --no-sync pytest bench --codspeed --no-cov && node harness/bench/cpu.ts
# Every case on the wall clock, TypeScript and Python alternating on one runner: the real gap to npm.
# Report only: the ratio table lands in the job summary and never fails the build.
bench:
name: bench (${{ matrix.name }})
runs-on: blacksmith-4vcpu-ubuntu-2404
timeout-minutes: 8
continue-on-error: true
strategy:
fail-fast: false
matrix:
include:
- name: cpu
groups: query,query_json,build,map,parse,parse_json,mutate_cpu,z2s,startup
- name: postgres
groups: run,mutate,pushproc
services:
postgres:
image: postgres:17
env:
POSTGRES_PASSWORD: postgres
ports: ["5432:5432"]
options: >-
--health-cmd pg_isready --health-interval 2s --health-timeout 5s --health-retries 30
env:
ZERO_SERVER_PG: postgresql://postgres:postgres@localhost:5432
steps:
- uses: useblacksmith/checkout@25227e61ff9dafe400e22fa487b673eac4e4409a # v1
with:
persist-credentials: false
- uses: astral-sh/setup-uv@1c37ad07a6a961277cf70c0d37d6f313000f5884 # v10.3.0
with:
python-version: "3.12"
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: "24"
- run: npm ci
working-directory: harness
- run: uv sync --locked
- run: uv run python -m bench --groups ${{ matrix.groups }}
- if: always()
run: cat bench/build/report.md >> "$GITHUB_STEP_SUMMARY" || true
- if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: bench-${{ matrix.name }}
if-no-files-found: ignore
path: |
bench/build/results.json
bench/build/report.md