mirror of
https://github.com/TryGhost/Ghost.git
synced 2025-02-10 23:36:14 -05:00
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:
parent
1aeac9777e
commit
7ef42a49fa
1 changed files with 14 additions and 3 deletions
17
.github/workflows/browser-tests.yml
vendored
17
.github/workflows/browser-tests.yml
vendored
|
@ -55,10 +55,21 @@ jobs:
|
||||||
- name: Run migrations
|
- name: Run migrations
|
||||||
working-directory: ghost/core
|
working-directory: ghost/core
|
||||||
run: yarn setup
|
run: yarn setup
|
||||||
|
- name: Get Playwright version
|
||||||
- name: Install Playwright
|
id: playwright-version
|
||||||
working-directory: ghost/core
|
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
|
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
|
- name: Build Admin
|
||||||
if: env.ENVIRONMENT == 'browser-tests-local'
|
if: env.ENVIRONMENT == 'browser-tests-local'
|
||||||
|
|
Loading…
Add table
Reference in a new issue