Repository navigation
107 lines (86 loc) · 3.26 KB
/
Copy pathci.yml
File metadata and controls
107 lines (86 loc) · 3.26 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
name: CI
on:
push:
branches: [main]
pull_request:
workflow_dispatch:
schedule:
# Weekly. Chrome stable ships roughly monthly, so this catches a behaviour
# change within days of release rather than whenever someone next builds.
- cron: '0 6 * * 1'
jobs:
typecheck:
# Its own job, not a step in `test`: it needs no Chrome, so it answers in
# under a minute instead of after a browser download. The mcp package is
# bundled by esbuild alone, which strips types without reading them — this
# is the only thing that type-checks it at all.
name: typecheck
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
# Builds first: mcp imports its siblings by package name, which resolve
# to their built declarations.
- run: npm run typecheck
test:
name: test (Chrome ${{ matrix.chrome }})
runs-on: ubuntu-latest
timeout-minutes: 15
strategy:
fail-fast: false
matrix:
# The version every claim in the README was measured against. Pinned so
# a Chrome release cannot silently change what this project asserts.
chrome: ['151.0.7922.71']
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Install Chrome ${{ matrix.chrome }}
run: |
# Prints "chrome@<version> <path>"; the path is the last field.
OUT=$(npx --yes @puppeteer/browsers install "chrome@${{ matrix.chrome }}")
echo "$OUT"
echo "CHROME_PATH=${OUT##* }" >> "$GITHUB_ENV"
- run: npm run build:all
- name: Test
run: npm test
drift:
name: drift check (Chrome stable)
# Separate from `test` on purpose: a Chrome release changing behaviour is
# something to learn about, not a reason to block an unrelated pull request.
if: github.event_name == 'schedule' || github.event_name == 'workflow_dispatch'
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
- name: Install Chrome stable
run: |
OUT=$(npx --yes @puppeteer/browsers install chrome@stable)
echo "$OUT"
echo "CHROME_PATH=${OUT##* }" >> "$GITHUB_ENV"
echo "CHROME_VERSION=$(echo "$OUT" | cut -d' ' -f1)" >> "$GITHUB_ENV"
- run: npm run build:all
- name: Test against Chrome stable
run: npm test
- name: Explain a failure
if: failure()
run: |
echo "::warning title=Chrome stable drift::${CHROME_VERSION} behaves differently from the pinned build."
echo "The platform-assumptions test prints what it measured at each worker pause point."
echo "Injection depends on undocumented behaviour: workers pause before their first line,"
echo "the beforeScriptExecution breakpoint exists, and codecs are absent at the earlier pause."
echo "A change there is a heads-up, not necessarily a defect — read the measurement first."