Repository navigation
203 lines (174 loc) · 6.5 KB
/
Copy pathexecution-plane.yml
File metadata and controls
203 lines (174 loc) · 6.5 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
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
name: execution-plane
# Second CI (spec 6, ADR-0002): Woodpecker only has Linux agents, so this
# workflow proves the runner on Linux, macOS and Windows and uploads the demo
# videos each OS rendered.
on:
pull_request:
paths: &paths
- packages/core/**
- packages/engine/**
- packages/renderer/**
- packages/playwright/**
- apps/cli/**
- apps/fixture/**
- package.json
- bun.lock
- .github/workflows/execution-plane.yml
push:
branches: [develop]
paths: *paths
workflow_dispatch:
inputs:
cdp_spike:
description: 'Run the #82 CDP capture spike probe instead of the suites'
type: boolean
default: false
permissions:
contents: read
concurrency:
group: execution-plane-${{ github.ref }}
cancel-in-progress: true
jobs:
execution-plane:
name: execution-plane (${{ matrix.os }})
if: ${{ !inputs.cdp_spike }}
runs-on: ${{ matrix.os }}
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
env:
DEMO_OUT: demo-out
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.0
- name: Install
run: bun install --frozen-lockfile
- name: Install Chromium (Linux, with system libraries)
if: runner.os == 'Linux'
run: bunx playwright install --with-deps chromium
- name: Install Chromium
if: runner.os != 'Linux'
run: bunx playwright install chromium
# Named explicitly: the CLI does not depend on the fixture, and the
# execution plane must build without apps/api, apps/web or Prisma.
- name: Build the execution plane and the fixture
run: bun run build --filter=@demoflow/cli --filter=@demoflow/fixture
- name: Test
run: >-
bun run test
--filter=@demoflow/core
--filter=@demoflow/engine
--filter=@demoflow/renderer
--filter=@demoflow/playwright
--filter=@demoflow/cli
# Spec 208, Decision 10: demoflow/playwright's probes on the older
# supported minors of @playwright/test (npm aliases in its
# devDependencies), each with its own Chromium. Linux only: what differs
# across versions is how Page and Locator tolerate a Proxy, not the OS.
- name: Test demoflow/playwright on @playwright/test 1.62 and 1.63
if: runner.os == 'Linux'
working-directory: packages/playwright
run: |
node ../../node_modules/playwright-test-1-62/cli.js install chromium
node ../../node_modules/playwright-test-1-63/cli.js install chromium
npx vitest run --config vitest.minors.config.ts
- name: Start the fixture preview
run: node .github/scripts/serve-fixture.mjs start
- name: Generate the fixture password
run: |
password="$(node -e "console.log(require('node:crypto').randomBytes(18).toString('hex'))")"
echo "::add-mask::$password"
echo "FIXTURE_PASSWORD=$password" >> "$GITHUB_ENV"
- name: Run customers
run: |
set +e
node apps/cli/dist/main.js run apps/fixture/demoflow/customers.demo.json --out "$DEMO_OUT" --json
code=$?
echo "demoflow run exited $code"
test "$code" -eq 0
- name: Run login
run: |
set +e
node apps/cli/dist/main.js run apps/fixture/demoflow/login.demo.json --out "$DEMO_OUT" --json
code=$?
echo "demoflow run exited $code"
test "$code" -eq 0
# The fixture's failing scenario must fail verification: exit 1 exactly.
# Exit 0 (it passed) and 2 or 3 (input or another stage) are all wrong.
- name: Run failing (expects exit 1)
run: |
set +e
node apps/cli/dist/main.js run apps/fixture/demoflow/failing.demo.json --out "$DEMO_OUT" --json
code=$?
echo "demoflow run exited $code"
test "$code" -eq 1
- name: Stop the fixture preview
if: always()
run: node .github/scripts/serve-fixture.mjs stop
- name: Upload the demos
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: demos-${{ matrix.os }}
path: |
${{ env.DEMO_OUT }}/runs/*/render/*.mp4
${{ env.DEMO_OUT }}/runs/*/result.json
if-no-files-found: error
retention-days: 14
# Spike #82, opt-in: dispatched by hand with `cdp_spike: true`, never on a
# pull request or a push. Measures what a CDP screencast delivers at
# deviceScaleFactor 2 on each OS (packages/engine/test/capture-spike).
cdp-spike:
name: cdp-spike (${{ matrix.os }})
if: ${{ inputs.cdp_spike }}
runs-on: ${{ matrix.os }}
timeout-minutes: 20
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
defaults:
run:
shell: bash
env:
DEMOFLOW_CDP_SPIKE: '1'
DEMOFLOW_CDP_SPIKE_OUT: cdp-spike-out
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
node-version: 24
- uses: oven-sh/setup-bun@0c5077e51419868618aeaa5fe8019c62421857d6 # v2.2.0
with:
bun-version: 1.4.0
- name: Install
run: bun install --frozen-lockfile
- name: Install Chromium (Linux, with system libraries)
if: runner.os == 'Linux'
run: bunx playwright install --with-deps chromium
- name: Install Chromium
if: runner.os != 'Linux'
run: bunx playwright install chromium
- name: Build core
run: bun run build --filter=@demoflow/core
- name: Probe the screencast
working-directory: packages/engine
run: npx vitest run test/capture-spike
- name: Upload the probe report
if: always()
uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 # v7.0.2
with:
name: cdp-spike-${{ matrix.os }}
path: packages/engine/${{ env.DEMOFLOW_CDP_SPIKE_OUT }}/*.json
if-no-files-found: error
retention-days: 14