Skip to content

Commit

Permalink
add caching of playwright browser binaries
Browse files Browse the repository at this point in the history
  • Loading branch information
Gregor Vostrak authored and Gregor Vostrak committed Jan 23, 2024
1 parent d129eeb commit e4e7684
Showing 1 changed file with 15 additions and 2 deletions.
17 changes: 15 additions & 2 deletions .github/workflows/playwright.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,8 +46,21 @@ jobs:
- name: Run Laravel Server
run: php artisan serve > /dev/null 2>&1 &

- name: Install Playwright Browsers
run: npx playwright install --with-deps
- 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@v3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
- run: npm ci
- run: npx playwright install --with-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: npx playwright install-deps
if: steps.playwright-cache.outputs.cache-hit != 'true'

- name: Run Playwright tests
run: npx playwright test
Expand Down

0 comments on commit e4e7684

Please sign in to comment.