Skip to content

Commit

Permalink
wip: pass workspace dir to playwright cacher
Browse files Browse the repository at this point in the history
  • Loading branch information
dgrebb committed Jan 16, 2024
1 parent eafac73 commit 114ed00
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
13 changes: 9 additions & 4 deletions .github/actions/cache-playwright/action.yml
Original file line number Diff line number Diff line change
@@ -1,12 +1,17 @@
name: "Install and Cache Playwright"
description: "Sets up a cache and/or installs Playwright and its binaries."

inputs:
WORKSPACE_ROOT:
description: "The workspace root."
required: true

runs:
using: "composite"
steps:
- name: Get installed Playwright version
shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
working-directory: ${{ inputs.WORKSPACE_ROOT }}
id: playwright-version
run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV

Expand All @@ -19,15 +24,15 @@ runs:
key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}

- shell: bash
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
working-directory: ${{ inputs.WORKSPACE_ROOT }}
run: npm ci

- shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
working-directory: ${{ inputs.WORKSPACE_ROOT }}
run: npx playwright install --with-deps

- shell: bash
if: steps.playwright-cache.outputs.cache-hit != 'true'
working-directory: ${{ steps.base.outputs.WORKSPACE_ROOT }}
working-directory: ${{ inputs.WORKSPACE_ROOT }}
run: npx playwright install-deps
2 changes: 2 additions & 0 deletions .github/workflows/backstop-sanity-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ jobs:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}

- uses: ./actions/.github/actions/cache-playwright
with:
WORKSPACE_ROOT: ${{ steps.base.outputs.WORKSPACE_ROOT }}

- name: "🎭 Run `npm run sanity-test-playwright`"
continue-on-error: true
Expand Down

0 comments on commit 114ed00

Please sign in to comment.