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 pnpm-lock.yaml
- name: Install dependencies - name: Install dependencies
run: pnpm install 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 - 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 - name: Run Tests
run: cd app && pnpm test:e2e run: cd app && pnpm test:e2e
env: env:
@ -36,6 +47,6 @@ jobs:
if: ${{ !cancelled() }} if: ${{ !cancelled() }}
with: with:
name: playwright-report name: playwright-report
path: app/test-results/ path: app/test-results/**/trace.zip
if-no-files-found: ignore if-no-files-found: ignore
retention-days: 30 retention-days: 30