feat: cache playwright binaries in GHA

This commit is contained in:
ndom91 2024-05-05 20:10:18 +02:00
parent 90185976ca
commit 17ad204a37
No known key found for this signature in database

View File

@ -25,8 +25,19 @@ jobs:
pnpm-lock.yaml
- name: Install dependencies
run: pnpm install
- name: Get installed Playwright version
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@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
run: pnpm dlx playwright@1.40.0 install --with-deps chromium
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: pnpm dlx "playwright@$PLAYWRIGHT_VERSION" install --with-deps chromium
- name: Run Tests
run: cd app && pnpm test:e2e
env:
@ -36,6 +47,6 @@ jobs:
if: ${{ !cancelled() }}
with:
name: playwright-report
path: app/test-results/
path: app/test-results/**/trace.zip
if-no-files-found: ignore
retention-days: 30