Skip to content

Commit

Permalink
cache playwright binaries and shard tests
Browse files Browse the repository at this point in the history
  • Loading branch information
M-Kusumgar committed Nov 7, 2024
1 parent fa4afe1 commit f8ebc09
Showing 1 changed file with 15 additions and 1 deletion.
16 changes: 15 additions & 1 deletion .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -51,17 +51,31 @@ jobs:

playwright-tests:
runs-on: ubuntu-latest
strategy:
matrix:
shard: [1, 2, 3, 4, 5, 6]
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-and-login
with:
build-and-run-server: true

- name: Get installed Playwright version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./app/static/package-lock.json').packages['node_modules/@playwright/test'].version)")" >> $GITHUB_ENV
- name: Cache playwright binaries
uses: actions/cache@v4
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- name: Install Playwright Browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps

- name: Test e2e
run: npm run test:e2e --prefix=app/static
run: npm run test:e2e --prefix=app/static -- --shard=${{ matrix.shard }}/6

lint:
runs-on: ubuntu-latest
Expand Down

0 comments on commit f8ebc09

Please sign in to comment.