From 114ed00cc7930fbafb139e969614be8e8c593ee9 Mon Sep 17 00:00:00 2001 From: Dan Grebb Date: Mon, 15 Jan 2024 21:39:54 -0500 Subject: [PATCH] wip: pass workspace dir to playwright cacher --- .github/actions/cache-playwright/action.yml | 13 +++++++++---- .github/workflows/backstop-sanity-test.yml | 2 ++ 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/.github/actions/cache-playwright/action.yml b/.github/actions/cache-playwright/action.yml index 8892bf5a0..db1f2f278 100644 --- a/.github/actions/cache-playwright/action.yml +++ b/.github/actions/cache-playwright/action.yml @@ -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 @@ -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 diff --git a/.github/workflows/backstop-sanity-test.yml b/.github/workflows/backstop-sanity-test.yml index f8c3cab1d..741c535d4 100644 --- a/.github/workflows/backstop-sanity-test.yml +++ b/.github/workflows/backstop-sanity-test.yml @@ -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