-
Notifications
You must be signed in to change notification settings - Fork 243
126 lines (118 loc) · 3.84 KB
/
Copy pathci.yml
File metadata and controls
126 lines (118 loc) · 3.84 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
# Continuous integration for Able Player
#
# Runs ESLint and both Jest projects (jsdom + puppeteer) on every push and
# pull request. The puppeteer project runs headless with request
# interception, so no demo server is needed. Build artifacts are compiled
# to confirm Grunt + Rollup succeed, but are never committed (per
# contributing.md).
#
# The accessibility job runs axe-core (WCAG 2.1 A/AA rules) plus keyboard
# operability checks over a representative demo set at four viewports
# (320px -> 4K). Automated checks catch only a fraction of WCAG failures —
# a green run prevents a class of regressions; it is not a conformance claim.
name: CI
on:
push:
branches: [main, develop]
pull_request:
permissions:
contents: read
# Superseded runs on the same ref are cancelled, so a force-push to an open
# pull request does not leave stale jobs occupying the queue.
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
lint:
name: ESLint
runs-on: ubuntu-latest
timeout-minutes: 10
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
# Only the puppeteer job launches a browser; skip puppeteer's Chromium
# download elsewhere (setup-node's npm cache does not cover it).
- run: npm ci
env:
PUPPETEER_SKIP_DOWNLOAD: "1"
- run: npm run lint
test:
name: Jest (jsdom)
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
env:
PUPPETEER_SKIP_DOWNLOAD: "1"
# webvtt.test.cjs loads build/test/webvtt.umd.js, so the suite must run
# against a fresh build rather than the committed bundle — otherwise a
# change to the WebVTT source is never actually exercised.
- run: npm run build
- run: npx jest --selectProjects jsdom
test-browser:
name: Jest (puppeteer, headless)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
# validate.test.cjs loads build/test/validate.umd.js
- run: npm run build
- run: npx jest --selectProjects puppeteer
build:
name: Build (Grunt + Rollup)
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
env:
PUPPETEER_SKIP_DOWNLOAD: "1"
- run: npm run build
- name: Confirm build outputs exist
run: |
test -s build/ableplayer.js
test -s build/ableplayer.min.js
test -s build/ableplayer.esm.js
test -s build/ableplayer.min.css
a11y:
name: Accessibility (axe + keyboard, 320px-4K)
runs-on: ubuntu-latest
timeout-minutes: 20
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- run: npm ci
# The demo pages load ../build/ableplayer.dist.js + ableplayer.min.css,
# so the suite always scans a fresh build, never a stale committed one.
- run: npm run build
- run: npx playwright install --with-deps chromium
# e2e/serve.mjs serves the repo root so the demos' relative ../build and
# ../media references resolve; Playwright boots it via playwright.config.js.
- run: npm run test:a11y
- name: Upload Playwright report on failure
if: failure()
uses: actions/upload-artifact@v4
with:
name: a11y-playwright-report
path: playwright-report/
retention-days: 14