Repository navigation
68 lines (61 loc) · 1.76 KB
/
Copy pathci.yml
File metadata and controls
68 lines (61 loc) · 1.76 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
#
# CI — run the tests on every pull request and every push to main.
#
# Netlify builds a preview for a pull request, which catches a build that
# throws but not an assertion that fails. This is what actually gates a merge.
#
# The two suites run as separate jobs so a contributor sees both results at
# once rather than only the first failure.
#
name: CI
on:
pull_request:
push:
branches: [main]
permissions:
contents: read
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
name: Build and test
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 test
layout:
name: Layout and accessibility
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
# The runner image ships Chrome, but pin it explicitly: if it ever stops
# doing so, this must fail loudly rather than let the suite skip.
- name: Locate Chrome
run: |
set -euo pipefail
for candidate in \
/usr/bin/google-chrome \
/usr/bin/google-chrome-stable \
/usr/bin/chromium \
/usr/bin/chromium-browser
do
if [ -x "$candidate" ]; then
echo "CHROME_PATH=$candidate" >> "$GITHUB_ENV"
echo "Using $candidate ($("$candidate" --version 2>/dev/null || echo '?'))"
exit 0
fi
done
echo "::error::No Chrome or Chromium on this runner — the layout tests cannot run."
exit 1
- run: npm run test:layout