Implemented Playwright caching into browser-tests workflow

- this allows us to use the Playwright cache that is in place to speed
  up tests
This commit is contained in:
Daniel Lockyer 2023-07-04 15:53:48 +02:00 committed by Daniel Lockyer
parent 1aeac9777e
commit 7ef42a49fa

View File

@ -55,10 +55,21 @@ jobs:
- name: Run migrations
working-directory: ghost/core
run: yarn setup
- name: Install Playwright
working-directory: ghost/core
- name: Get Playwright version
id: playwright-version
run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
name: Check if Playwright browser is cached
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-Playwright-${{steps.playwright-version.outputs.version}}
- name: Install Playwright browser if not cached
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx playwright install --with-deps
- name: Install OS dependencies of Playwright if cache hit
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx playwright install-deps
- name: Build Admin
if: env.ENVIRONMENT == 'browser-tests-local'