Repository navigation
132 lines (124 loc) · 4.08 KB
/
Copy pathci.yml
File metadata and controls
132 lines (124 loc) · 4.08 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
name: CI
on:
push:
branches: [master, main]
pull_request:
# Cancel duplicate runs on the same PR.
concurrency:
group: ci-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
check:
name: TypeScript check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run check
- run: npm test -w sdk
- run: npm test -w registry
harness:
name: Integration harness
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
# Scenario 50 needs a real Chrome; /usr/bin/chromium on ubuntu-24.04 is
# a snap shim that starts slowly or not at all (see chrome-ext-e2e).
- id: setup-chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
- run: npm ci
# Builds the SDK, then boots its own wrangler dev for the run.
# --continue: one failure must not skip (and hide) every later scenario.
- env:
CHROMIUM_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: npm run harness -- --continue
chrome-ext-unit:
name: Chrome extension — unit
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm ci
- run: npm run ext:test:unit
vendor-freshness:
name: chrome-extension/lib/sdk vendor-freshness
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- run: npm ci
# Build SDK and re-run the vendor script. If the vendored files in
# chrome-extension/lib/sdk/ are out of date with sdk/dist/, the diff
# check below fails the build and the PR is blocked.
- run: npm run build -w sdk
- run: bash chrome-extension/scripts/vendor-sdk.sh
- name: Assert no drift in vendored SDK
run: |
git diff --exit-code -- chrome-extension/lib/sdk \
|| (echo "::error::Vendored SDK in chrome-extension/lib/sdk/ is stale."; \
echo "Run: npm run build -w sdk && bash chrome-extension/scripts/vendor-sdk.sh"; \
exit 1)
chrome-ext-e2e:
name: Chrome extension — E2E (chromium headless=new)
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
# Use setup-chrome instead of `apt-get install chromium-browser`:
# on ubuntu-24.04 the apt package is a snap shim that needs snapd
# (unavailable in CI) and fails to launch.
- id: setup-chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
- run: npm ci
- name: Set up .dev.vars
run: cp relay/.dev.vars.example relay/.dev.vars
- env:
CHROMIUM_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: npm run ext:test:reconnect
chrome-ext-popup:
name: Chrome extension — real toolbar popup
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
# Full history: the update case loads the extension at an older commit.
- uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- id: setup-chrome
uses: browser-actions/setup-chrome@latest
with:
chrome-version: stable
- run: npm ci
- name: Set up .dev.vars
run: cp relay/.dev.vars.example relay/.dev.vars
# The toolbar popup only opens in a headed browser, so this runs under xvfb.
- env:
CHROMIUM_PATH: ${{ steps.setup-chrome.outputs.chrome-path }}
run: npm run ext:test:popup