From f478c9ce9e6f3f271a3d21926568571d3bed2568 Mon Sep 17 00:00:00 2001 From: Himself65 Date: Mon, 27 Mar 2023 23:21:51 -0500 Subject: [PATCH] ci: disable playwright install by default (#1715) --- .github/actions/setup-node/action.yml | 10 ++++++++-- .github/workflows/build-master.yml | 2 ++ .github/workflows/build.yml | 2 ++ 3 files changed, 12 insertions(+), 2 deletions(-) diff --git a/.github/actions/setup-node/action.yml b/.github/actions/setup-node/action.yml index 482e6d466f..2fbd56e41f 100644 --- a/.github/actions/setup-node/action.yml +++ b/.github/actions/setup-node/action.yml @@ -13,6 +13,10 @@ inputs: description: 'Run the install step for the electron workspace.' required: false default: 'false' + playwright-install: + description: 'Run the install step for Playwright.' + required: false + default: 'false' npm-token: description: 'The NPM token to use for private packages.' required: false @@ -89,8 +93,9 @@ runs: - name: Get installed Playwright version id: playwright-version + if: ${{ inputs.playwright-install == 'true' }} shell: bash - run: echo "::set-output name=version::$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')" + run: echo "{version}=$(yarn why --json @playwright/test | grep -h 'workspace:.' | jq --raw-output '.children[].locator' | sed -e 's/@playwright\/test@.*://')" >> GITHUB_OUTPUT # Attempt to restore the correct Playwright browser binaries based on the # currently installed version of Playwright (The browser binary versions @@ -100,6 +105,7 @@ runs: # it out for us. - uses: actions/cache@v3 id: playwright-cache + if: ${{ inputs.playwright-install == 'true' }} with: path: '~/.cache/ms-playwright' key: '${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.version }}' @@ -118,5 +124,5 @@ runs: # paywright to install everything for us. - name: Install Playwright's dependencies shell: bash - if: steps.playwright-cache.outputs.cache-hit != 'true' + if: inputs.playwright-install == 'true' && steps.playwright-cache.outputs.cache-hit != 'true' run: yarn playwright install --with-deps diff --git a/.github/workflows/build-master.yml b/.github/workflows/build-master.yml index 9fd8bc67b1..9b96405680 100644 --- a/.github/workflows/build-master.yml +++ b/.github/workflows/build-master.yml @@ -110,6 +110,8 @@ jobs: - uses: actions/checkout@v3 - name: Setup Node.js uses: ./.github/actions/setup-node + with: + playwright-install: true - name: Download artifact uses: actions/download-artifact@v3 with: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5ee987332a..f343b01243 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -59,6 +59,8 @@ jobs: - uses: actions/checkout@v3 - name: Setup Node.js uses: ./.github/actions/setup-node + with: + playwright-install: true - name: Download artifact uses: actions/download-artifact@v3 with: