Skip to content

Commit e838556

Browse files
committed
ci: Streamline CI browser playwright tests
1 parent 6cbc416 commit e838556

File tree

2 files changed

+16
-7
lines changed

2 files changed

+16
-7
lines changed

.github/actions/install-playwright/action.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,9 @@
11
name: "Install Playwright dependencies"
22
description: "Installs Playwright dependencies and caches them."
3+
inputs:
4+
browsers:
5+
description: 'What browsers to install.'
6+
default: 'chromium webkit firefox'
37

48
runs:
59
using: "composite"
@@ -17,12 +21,13 @@ runs:
1721
~/.cache/ms-playwright
1822
key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}
1923

24+
# We always install all browsers, if uncached
2025
- name: Install Playwright dependencies (uncached)
2126
run: npx playwright install chromium webkit firefox --with-deps
2227
if: steps.playwright-cache.outputs.cache-hit != 'true'
2328
shell: bash
2429

2530
- name: Install Playwright system dependencies only (cached)
26-
run: npx playwright install-deps chromium webkit firefox
31+
run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }}
2732
if: steps.playwright-cache.outputs.cache-hit == 'true'
2833
shell: bash

.github/workflows/build.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -548,7 +548,7 @@ jobs:
548548
project:
549549
- chromium
550550
include:
551-
# Only check all projects for esm & full bundle
551+
# Only check all projects for full bundle
552552
# We also shard the tests as they take the longest
553553
- bundle: bundle_tracing_replay_feedback_min
554554
project: ''
@@ -559,16 +559,17 @@ jobs:
559559
shard: 2
560560
shards: 2
561561
- bundle: esm
562-
project: ''
563562
shard: 1
564-
shards: 3
563+
shards: 4
565564
- bundle: esm
566565
shard: 2
567-
shards: 3
566+
shards: 4
568567
- bundle: esm
569-
project: ''
570568
shard: 3
571-
shards: 3
569+
shards: 4
570+
- bundle: esm
571+
shard: 4
572+
shards: 4
572573
exclude:
573574
# Do not run the default chromium-only tests
574575
- bundle: bundle_tracing_replay_feedback_min
@@ -592,12 +593,15 @@ jobs:
592593

593594
- name: Install Playwright
594595
uses: ./.github/actions/install-playwright
596+
with:
597+
browsers: ${{ matrix.project }}
595598

596599
- name: Run Playwright tests
597600
env:
598601
PW_BUNDLE: ${{ matrix.bundle }}
599602
working-directory: dev-packages/browser-integration-tests
600603
run: yarn test:ci${{ matrix.project && format(' --project={0}', matrix.project) || '' }}${{ matrix.shard && format(' --shard={0}/{1}', matrix.shard, matrix.shards) || '' }}
604+
601605
- name: Upload Playwright Traces
602606
uses: actions/upload-artifact@v3
603607
if: always()

0 commit comments

Comments
 (0)