Skip to content

Commit 9071f45

Browse files
authored
Merge pull request #21359 from Snuffleupagus/coverage-browser-tests
Run browser tests to collect code coverage data
2 parents b168293 + 890edc9 commit 9071f45

1 file changed

Lines changed: 99 additions & 0 deletions

File tree

Lines changed: 99 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,99 @@
1+
name: Coverage (Browser tests)
2+
on:
3+
push:
4+
paths:
5+
- 'gulpfile.mjs'
6+
- 'external/builder/**'
7+
- 'src/**'
8+
- 'test/images/**'
9+
- 'test/pdfs/**'
10+
- 'test/resources/**'
11+
- 'test/*.css'
12+
- 'test/driver.js'
13+
- 'test/test.mjs'
14+
- 'test/test_manifest.json'
15+
- 'test/test_slave.html'
16+
- 'web/**'
17+
- '.github/workflows/coverage_browser_tests.yml'
18+
branches:
19+
- master
20+
pull_request:
21+
paths:
22+
- 'gulpfile.mjs'
23+
- 'external/builder/**'
24+
- 'src/**'
25+
- 'test/images/**'
26+
- 'test/pdfs/**'
27+
- 'test/resources/**'
28+
- 'test/*.css'
29+
- 'test/driver.js'
30+
- 'test/test.mjs'
31+
- 'test/test_manifest.json'
32+
- 'test/test_slave.html'
33+
- 'web/**'
34+
- '.github/workflows/coverage_browser_tests.yml'
35+
branches:
36+
- master
37+
workflow_dispatch:
38+
permissions:
39+
contents: read
40+
41+
jobs:
42+
test:
43+
name: ${{ matrix.os }} / firefox
44+
45+
strategy:
46+
fail-fast: false
47+
matrix:
48+
node-version: [lts/*]
49+
os: [ubuntu-latest]
50+
51+
runs-on: ${{ matrix.os }}
52+
environment: code-coverage
53+
54+
steps:
55+
- name: Checkout repository
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
with:
58+
fetch-depth: 0
59+
persist-credentials: false
60+
61+
- name: Use Node.js ${{ matrix.node-version }}
62+
uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6.4.0
63+
with:
64+
node-version: ${{ matrix.node-version }}
65+
cache: 'npm'
66+
67+
- name: Install dependencies
68+
run: npm ci
69+
70+
- name: Restore cached PDF files
71+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
72+
with:
73+
path: test/pdfs/*.pdf
74+
key: cached-pdf-files-${{ hashFiles('test/pdfs/*.pdf') }}
75+
restore-keys: |
76+
cached-pdf-files-
77+
enableCrossOsArchive: true
78+
79+
- name: Run browser tests with code coverage
80+
run: npx gulp botbrowsertest --headless -j$(nproc) --coverage --coverage-output build/coverage/browser --noChrome
81+
82+
- name: Save cached PDF files
83+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
84+
with:
85+
path: test/pdfs/*.pdf
86+
key: cached-pdf-files-${{ hashFiles('test/pdfs/*.pdf') }}
87+
enableCrossOsArchive: true
88+
89+
- name: Upload results to Codecov
90+
uses: codecov/codecov-action@e79a6962e0d4c0c17b229090214935d2e33f8354 # v6.0.1
91+
with:
92+
token: ${{ secrets.CODECOV_TOKEN }}
93+
fail_ci_if_error: true
94+
files: ./build/coverage/browser/lcov.info
95+
flags: browsertest
96+
name: codecov-umbrella
97+
disable_search: true
98+
disable_telem: true
99+
verbose: true

0 commit comments

Comments
 (0)