Skip to content

Commit 485dcb7

Browse files
committed
Split the unit/font tests into per-browser jobs
This commit mirrors the approach from e656b83 to the other workflows that run multiple OS/browser combinations. This approach has multiple advantages: - it improves performance because each job is run in its own environment so we don't have two browsers competing for resources in the same environment anymore; - it improves monitoring because each job is shown separately, with its own runtime, in e.g. the pull request checks and actions overviews, which makes it easier to spot bottlenecks that are specific to a certain OS/browser combination and enable follow-up optimizations.
1 parent e66fdfb commit 485dcb7

2 files changed

Lines changed: 16 additions & 4 deletions

File tree

.github/workflows/font_tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,19 @@ permissions:
2424

2525
jobs:
2626
test:
27-
name: Test
27+
name: ${{ matrix.os }} / ${{ matrix.browser }}
2828

2929
strategy:
3030
fail-fast: false
3131
matrix:
3232
node-version: [lts/*]
3333
os: [windows-latest, ubuntu-latest]
34+
browser: [firefox, chrome]
35+
include:
36+
- browser: firefox
37+
skip: --noChrome
38+
- browser: chrome
39+
skip: --noFirefox
3440

3541
runs-on: ${{ matrix.os }}
3642
environment: code-coverage
@@ -62,7 +68,7 @@ jobs:
6268
run: pip install -r .github/font_tests_requirements.txt
6369

6470
- name: Run font tests with code coverage
65-
run: npx gulp fonttest --headless --coverage --coverage-output build/coverage/font
71+
run: npx gulp fonttest --headless --coverage --coverage-output build/coverage/font ${{ matrix.skip }}
6672

6773
- name: Upload results to Codecov
6874
uses: codecov/codecov-action@57e3a136b779b570ffcdbf80b3bdc90e7fab3de2 # v6.0.0

.github/workflows/unit_tests.yml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,19 @@ permissions:
2626

2727
jobs:
2828
test:
29-
name: Test
29+
name: ${{ matrix.os }} / ${{ matrix.browser }}
3030

3131
strategy:
3232
fail-fast: false
3333
matrix:
3434
node-version: [lts/*]
3535
os: [windows-latest, ubuntu-latest]
36+
browser: [firefox, chrome]
37+
include:
38+
- browser: firefox
39+
skip: --noChrome
40+
- browser: chrome
41+
skip: --noFirefox
3642

3743
runs-on: ${{ matrix.os }}
3844
environment: code-coverage
@@ -63,7 +69,7 @@ jobs:
6369
enableCrossOsArchive: true
6470

6571
- name: Run unit tests with code coverage
66-
run: npx gulp unittest --headless --coverage --coverage-output build/coverage/unit
72+
run: npx gulp unittest --headless --coverage --coverage-output build/coverage/unit ${{ matrix.skip }}
6773

6874
- name: Save cached PDF files
6975
uses: actions/cache/save@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5

0 commit comments

Comments
 (0)