From 17a2b33b3ecd902dc88bf0e7f981e982271ca411 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Tue, 13 Aug 2024 17:12:57 +0200 Subject: [PATCH 1/2] ci: Never cache playwright --- .github/actions/install-playwright/action.yml | 24 ++----------------- 1 file changed, 2 insertions(+), 22 deletions(-) diff --git a/.github/actions/install-playwright/action.yml b/.github/actions/install-playwright/action.yml index 7f85f5e743ba..a31c614384fe 100644 --- a/.github/actions/install-playwright/action.yml +++ b/.github/actions/install-playwright/action.yml @@ -8,26 +8,6 @@ inputs: runs: using: "composite" steps: - - name: Get Playwright version - id: playwright-version - run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT - shell: bash - - - name: Cache playwright binaries - uses: actions/cache@v4 - id: playwright-cache - with: - path: | - ~/.cache/ms-playwright - key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} - - # We always install all browsers, if uncached - - name: Install Playwright dependencies (uncached) - run: npx playwright install chromium webkit firefox --with-deps - if: steps.playwright-cache.outputs.cache-hit != 'true' - shell: bash - - - name: Install Playwright system dependencies only (cached) - run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }} - if: steps.playwright-cache.outputs.cache-hit == 'true' + - name: Install Playwright dependencies + run: npx playwright install ${{ inputs.browsers || 'chromium webkit firefox' }} --with-deps shell: bash From 0f3d512912d5e75d4f45cc974926e0afb339d233 Mon Sep 17 00:00:00 2001 From: Francesco Novy Date: Wed, 14 Aug 2024 10:28:42 +0200 Subject: [PATCH 2/2] only cache on develop --- .github/actions/install-playwright/action.yml | 33 +++++++++++++++++-- 1 file changed, 31 insertions(+), 2 deletions(-) diff --git a/.github/actions/install-playwright/action.yml b/.github/actions/install-playwright/action.yml index a31c614384fe..9de6e1a2b104 100644 --- a/.github/actions/install-playwright/action.yml +++ b/.github/actions/install-playwright/action.yml @@ -8,6 +8,35 @@ inputs: runs: using: "composite" steps: - - name: Install Playwright dependencies - run: npx playwright install ${{ inputs.browsers || 'chromium webkit firefox' }} --with-deps + - name: Get Playwright version + id: playwright-version + run: echo "version=$(node -p "require('@playwright/test/package.json').version")" >> $GITHUB_OUTPUT + shell: bash + + - name: Restore cached playwright binaries + uses: actions/cache/restore@v4 + id: playwright-cache + with: + path: | + ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + + # Only store cache on develop branch + - name: Store cached playwright binaries + uses: actions/cache/save@v4 + if: github.event_name == 'push' && github.ref == 'refs/heads/develop' + with: + path: | + ~/.cache/ms-playwright + key: playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }} + + # We always install all browsers, if uncached + - name: Install Playwright dependencies (uncached) + run: npx playwright install chromium webkit firefox --with-deps + if: steps.playwright-cache.outputs.cache-hit != 'true' + shell: bash + + - name: Install Playwright system dependencies only (cached) + run: npx playwright install-deps ${{ inputs.browsers || 'chromium webkit firefox' }} + if: steps.playwright-cache.outputs.cache-hit == 'true' shell: bash