Skip to content

Commit

Permalink
try playwright cache strategy
Browse files Browse the repository at this point in the history
  • Loading branch information
vincerubinetti committed Aug 13, 2024
1 parent a254514 commit 6d328de
Showing 1 changed file with 25 additions and 2 deletions.
27 changes: 25 additions & 2 deletions .github/workflows/test-frontend.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,6 @@ jobs:
# run end to end integration tests
test-e2e:
runs-on: ubuntu-latest
container:
image: mcr.microsoft.com/playwright:v1.46.0-jammy
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand All @@ -89,5 +87,30 @@ jobs:
if: runner.debug == '1'
uses: mxschmitt/action-tmate@v3

- name: Get Playwright version
run: |
PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//')
echo "Playwright Version: $PLAYWRIGHT_VERSION"
echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV
- name: Cache Playwright
id: cache-playwright
uses: actions/cache@v3
with:
path: ~/.cache/ms-playwright
key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }}

- name: Install Playwright
if: steps.cache-playwright.outputs.cache-hit != 'true'
run: bunx playwright install --with-deps

- name: Run test
run: bun run test:e2e

- name: Store Artifacts from Failed Tests
if: failure()
uses: actions/upload-artifact@v2
with:
name: test-results
path: test-results/
retention-days: 30

0 comments on commit 6d328de

Please sign in to comment.