-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (101 loc) · 4.04 KB
/
Copy pathci.yml
File metadata and controls
107 lines (101 loc) · 4.04 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
# Runs on GitHub, where this repository is published. GitLab ignores this file
# and uses .gitlab-ci.yml; both describe the same checks, so keep them in step.
#
# Split in two so a red run says which kind of check broke: "unit" is the fast
# feedback loop, "integration" drives real browsers, SSR servers and a consumer
# build. Each job prints its environment first, so a failure log states the
# runner architecture, Node version and which browser resolved.
#
# Not covered here: Safari (needs macOS), screen-reader speech, and complete
# accessibility conformance.
name: CI
on:
push:
branches: [main]
pull_request:
permissions:
contents: read
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
unit:
name: Unit tests, build and documentation
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
- name: Print environment
run: echo "arch=$(uname -m) node=$(node -v) npm=$(npm -v)"
- name: Resolve a browser
# @web/test-runner launches Chrome through chrome-launcher, which honours
# CHROME_PATH. Fail here with the reason rather than inside a test run.
run: |
for candidate in "${CHROME_PATH:-}" "$(command -v google-chrome || true)" "$(command -v chromium || true)"; do
if [ -n "$candidate" ] && [ -x "$candidate" ]; then
echo "CHROME_PATH=$candidate" >> "$GITHUB_ENV"
echo "browser: $candidate ($("$candidate" --version 2>&1 | head -1))"
exit 0
fi
done
echo "No Chrome or Chromium on this runner; the unit tests need one." >&2
exit 1
- run: npm ci
- run: npm test
- run: npm run build
- run: npm run test:docs
integration:
name: Browsers, SSR and Angular AOT
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- uses: actions/checkout@v5
- uses: actions/setup-node@v5
with:
node-version: 22
cache: npm
cache-dependency-path: |
package-lock.json
test/ssr/package-lock.json
test/angular-aot/package-lock.json
- name: Print environment
run: echo "arch=$(uname -m) node=$(node -v) npm=$(npm -v)"
- name: Install CJK fonts
# Demos and fixtures contain Chinese text; without these fonts the
# layout and size assertions measure fallback glyphs.
run: sudo apt-get update -qq && sudo apt-get install -y -qq fonts-noto-cjk > /dev/null
- run: npm ci
# Consumers always test a fresh build, so this precedes every check below.
- run: npm run build
- run: npm ci --prefix test/ssr
- name: Install Chrome for Playwright
# The browser suites request channel 'chrome'; Playwright installs the
# branded build that channel resolves to.
run: npm --prefix test/ssr exec -- playwright install --with-deps chrome
- name: Print browser versions
run: |
echo "playwright: $(npm --prefix test/ssr exec -- playwright --version)"
- run: npm run test:css -- chrome
- run: npm run test:controls -- chrome
- run: npm run test:pagination -- chrome
- run: npm run test:visibility
- run: npm run test:demo-safety
- run: npm run test:form-flow
- run: npm run test:dropdown:chrome
- run: node test/browser/tree.mjs chrome
- run: node test/browser/accordion.mjs chrome
- run: node test/browser/breadcrumbs-html.mjs chrome
- run: node test/browser/card.mjs chrome
- run: node test/browser/carousel.mjs chrome
- run: node test/browser/file-upload.mjs chrome
- name: SSR across Next, Nuxt and Angular
run: npm test --prefix test/ssr
- run: npm ci --prefix test/angular-aot
- run: npm run check --prefix test/angular-aot
- name: Angular AOT consumer runtime
# preruntime builds the fixture first.
run: npm run runtime --prefix test/angular-aot