Skip to content

Commit da0b99c

Browse files
authored
Merge pull request #20371 from timvandermeij/github-actions-integration-tests
Introduce a GitHub Actions workflow for running the integration tests
2 parents 3b8f556 + ce998f1 commit da0b99c

1 file changed

Lines changed: 85 additions & 0 deletions

File tree

Lines changed: 85 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
name: Integration tests
2+
on:
3+
push:
4+
paths:
5+
- 'gulpfile.mjs'
6+
- 'src/**'
7+
- 'test/test.mjs'
8+
- 'test/integration/**'
9+
- 'web/**'
10+
- '.github/workflows/integration_tests.yml'
11+
branches:
12+
- master
13+
pull_request:
14+
paths:
15+
- 'gulpfile.mjs'
16+
- 'src/**'
17+
- 'test/test.mjs'
18+
- 'test/integration/**'
19+
- 'web/**'
20+
- '.github/workflows/integration_tests.yml'
21+
branches:
22+
- master
23+
workflow_dispatch:
24+
permissions:
25+
contents: read
26+
27+
jobs:
28+
test:
29+
name: Test
30+
31+
strategy:
32+
fail-fast: false
33+
matrix:
34+
node-version: [lts/*]
35+
os: [windows-latest, ubuntu-latest]
36+
37+
runs-on: ${{ matrix.os }}
38+
39+
steps:
40+
- name: Checkout repository
41+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
42+
with:
43+
fetch-depth: 0
44+
persist-credentials: false
45+
46+
- name: Use Node.js ${{ matrix.node-version }}
47+
uses: actions/setup-node@53b83947a5a98c8d113130e565377fae1a50d02f # v6.3.0
48+
with:
49+
node-version: ${{ matrix.node-version }}
50+
cache: 'npm'
51+
52+
- name: Install dependencies
53+
run: npm ci
54+
55+
- name: Restore cached PDF files
56+
uses: actions/cache/restore@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
57+
with:
58+
path: test/pdfs/*.pdf
59+
key: cached-pdf-files-${{ hashFiles('test/pdfs/*.pdf') }}
60+
restore-keys: |
61+
cached-pdf-files-
62+
enableCrossOsArchive: true
63+
64+
# Note that the integration tests can't run in headless mode until bug
65+
# 1878643 (tracked in #20918), and possibly others, have been fixed
66+
# upstream, so we can't run with the `--headless` flag and thus have to
67+
# configure a standard resolution for the headful browser windows.
68+
- name: Update resolution (Windows)
69+
if: ${{ matrix.os == 'windows-latest' }}
70+
run: Set-DisplayResolution -Width 1920 -Height 1080 -Force
71+
72+
- name: Run integration tests (Windows)
73+
if: ${{ matrix.os == 'windows-latest' }}
74+
run: npx gulp integrationtest
75+
76+
- name: Run integration tests (Linux)
77+
if: ${{ matrix.os == 'ubuntu-latest' }}
78+
run: xvfb-run -a --server-args="-screen 0, 1920x1080x24" npx gulp integrationtest
79+
80+
- name: Save cached PDF files
81+
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
82+
with:
83+
path: test/pdfs/*.pdf
84+
key: cached-pdf-files-${{ hashFiles('test/pdfs/*.pdf') }}
85+
enableCrossOsArchive: true

0 commit comments

Comments
 (0)