Skip to content

Commit

Permalink
ci: 👷 cache Playwright to improve CI performance
Browse files Browse the repository at this point in the history
  • Loading branch information
nstringham committed Oct 24, 2022
1 parent cb1218a commit 307806d
Showing 1 changed file with 17 additions and 1 deletion.
18 changes: 17 additions & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -166,6 +166,17 @@ jobs:
distribution: "adopt"
java-version: "11"

- name: Get Playwright Version
id: playwright-version
run: echo "::set-output name=version::$(node -e "console.log(require('./client/package-lock.json').dependencies['@playwright/test'].version)")"

- name: Cache Playwright
uses: actions/cache@v3
id: playwright-cache
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}

- name: Install Node Dependencies
run: |
npm --prefix functions ci
Expand All @@ -174,9 +185,14 @@ jobs:
- name: Install firebase emulators
run: npm i -g firebase-tools

- name: Install Playwright
- name: Install Playwright and it's Dependencies
if: steps.playwright-cache.outputs.cache-hit != 'true'
run: npx --prefix client playwright install --with-deps

- name: Install Playwright's Dependencies
if: steps.playwright-cache.outputs.cache-hit == 'true'
run: npx --prefix client playwright install-deps

- name: Test
run: npm --prefix client run test
env:
Expand Down

0 comments on commit 307806d

Please sign in to comment.