-
-
Notifications
You must be signed in to change notification settings - Fork 389
90 lines (84 loc) · 2.57 KB
/
pr.yml
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
name: Node CI (PR)
on:
pull_request:
paths-ignore:
- "**"
- "!**.js"
- "!**.cjs"
- "!**.json"
- "!**.css"
- "!**.html"
- "!.github/workflows/**"
env:
PUPPETEER_SKIP_DOWNLOAD: 1
PUPPETEER_EXECUTABLE_PATH: /usr/bin/google-chrome
# See https://github.com/speced/respec/pull/3306
LC_ALL: en_US.UTF-8
FORCE_COLOR: 1
permissions:
contents: read
jobs:
lint:
name: Check linting issues
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Ensure builds/ has not changed
run: |
curl -sL https://api.github.com/repos/speced/respec/pulls/${{ github.event.pull_request.number }}/files -o /tmp/pr_files.json
cat /tmp/pr_files.json | jq -r '.[].filename' | grep -qE "^builds/" || exit 0
echo "::error::Uh oh! builds/ was changed."; exit 1
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version-file: '.nvmrc', cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm lint
test-headless:
name: Headless Tests
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version-file: '.nvmrc', cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm test:build
- run: pnpm build:w3c
- run: pnpm test:headless
test-karma:
name: Karma Unit Tests (${{ matrix.browser }})
strategy:
matrix:
browser: [ChromeHeadless, FirefoxHeadless]
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version-file: '.nvmrc', cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c & pnpm build:geonovum
- run: pnpm test:unit
env:
BROWSERS: ${{ matrix.browser }}
- run: pnpm test:integration
env:
BROWSERS: ${{ matrix.browser }}
html-validate:
name: Validate HTML
runs-on: ubuntu-latest
needs: lint
steps:
- uses: actions/checkout@v4
- uses: pnpm/action-setup@v4
- uses: actions/setup-node@v4
with: { node-version-file: '.nvmrc', cache: pnpm }
- run: pnpm i --frozen-lockfile
- run: pnpm build:w3c
- name: run validator
run: |
vnu=$(node -p "require('vnu-jar')")
./tools/respec2html.js examples/basic.built.html /tmp/basic.built.html --verbose --timeout 30
java -jar $vnu /tmp/basic.built.html