mirror of
https://github.com/suitenumerique/drive.git
synced 2026-09-29 21:15:18 +02:00
⚡️(ci) shard e2e tests and cache playwright browsers
E2e tests take 20-23min per browser because they run sequentially on a single runner with no browser caching. Shard tests across 3 parallel runners per browser and cache Playwright browser binaries to reduce wall-clock time to ~7min per browser.
This commit is contained in:
@@ -66,11 +66,16 @@ jobs:
|
||||
runs-on: ubuntu-latest
|
||||
needs: [install-front, build-mails]
|
||||
strategy:
|
||||
fail-fast: false
|
||||
matrix:
|
||||
browser:
|
||||
- chromium
|
||||
- webkit
|
||||
- firefox
|
||||
shard:
|
||||
- "1/3"
|
||||
- "2/3"
|
||||
- "3/3"
|
||||
steps:
|
||||
- name: Checkout repository
|
||||
uses: actions/checkout@v6
|
||||
@@ -93,6 +98,13 @@ jobs:
|
||||
path: "src/backend/core/templates/mail"
|
||||
key: mail-templates-${{ hashFiles('src/mail/mjml') }}
|
||||
|
||||
- name: Cache Playwright browsers
|
||||
id: playwright-cache
|
||||
uses: actions/cache@v4
|
||||
with:
|
||||
path: ~/.cache/ms-playwright
|
||||
key: playwright-${{ matrix.browser }}-${{ hashFiles('src/frontend/**/yarn.lock') }}
|
||||
|
||||
- name: Install Playwright Browsers
|
||||
run: |
|
||||
cd src/frontend/apps/e2e
|
||||
@@ -113,11 +125,11 @@ jobs:
|
||||
- name: Run e2e tests
|
||||
run: |
|
||||
cd src/frontend/apps/e2e
|
||||
yarn test --project=${{ matrix.browser }}
|
||||
yarn test --project=${{ matrix.browser }} --shard=${{ matrix.shard }}
|
||||
|
||||
- uses: actions/upload-artifact@v4
|
||||
if: always()
|
||||
with:
|
||||
name: report-${{ matrix.browser }}
|
||||
name: report-${{ matrix.browser }}-shard-${{ strategy.job-index }}
|
||||
path: src/frontend/apps/e2e/report/
|
||||
retention-days: 7
|
||||
|
||||
Reference in New Issue
Block a user