Skip to content

Commit

Permalink
feat: add playwright browser caching to gha
Browse files Browse the repository at this point in the history
  • Loading branch information
ndom91 committed Oct 26, 2024
1 parent 865a085 commit f5f59c7
Showing 1 changed file with 30 additions and 19 deletions.
49 changes: 30 additions & 19 deletions .github/workflows/test-e2e-playwright.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name: E2E Tests Playwright
on:
pull_request:
branches: [ master ]
branches: [master]
workflow_dispatch:
inputs:
sha:
Expand All @@ -15,21 +15,32 @@ jobs:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ github.event.inputs.sha }}
- name: Setup node environment
uses: ./.github/actions/init-env-node
- name: Install Playwright Browsers
run: cd apps/web && pnpm exec playwright install --with-deps
- name: Run Playwright tests
run: pnpm exec turbo run test:e2e:playwright
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- uses: actions/checkout@v4
if: ${{ github.event_name != 'workflow_dispatch' }}
- uses: actions/checkout@v4
if: ${{ github.event_name == 'workflow_dispatch' }}
with:
ref: ${{ github.event.inputs.sha }}
- name: Setup node environment
uses: ./.github/actions/init-env-node

- id: get_playwright_version
uses: eviden-actions/get-playwright-version@v1
- name: Cache playwright binaries
uses: actions/cache@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.get_playwright_version.outputs.playwright-version }}
- if: steps.playwright-cache.outputs.cache-hit != 'true'
run: cd apps/web && pnpm exec playwright install --with-deps

- name: Run Playwright tests
run: pnpm exec turbo run test:e2e:web
- uses: actions/upload-artifact@v4
if: ${{ !cancelled() }}
with:
name: playwright-report
path: playwright-report/
retention-days: 30

0 comments on commit f5f59c7

Please sign in to comment.