diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index bf558aaf2..f17616fcf 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -167,9 +167,25 @@ jobs: - name: Install JavaScript dependencies run: yarn install --frozen-lockfile - - name: Install Playwright browsers + - name: Get Playwright version + id: playwright-version + run: echo "version=$(npx playwright --version)" >> "$GITHUB_OUTPUT" + + - name: Cache Playwright browsers + id: playwright-cache + uses: actions/cache@0057852bfaa89a56745cba8c7296529d2fc39830 # v4.3.0 + with: + path: ~/.cache/ms-playwright + key: playwright-${{ matrix.browser }}-${{ steps.playwright-version.outputs.version }} + + - name: Install Playwright browser + if: steps.playwright-cache.outputs.cache-hit != 'true' run: npx playwright install --with-deps ${{ matrix.browser }} + - name: Install Playwright system deps + if: steps.playwright-cache.outputs.cache-hit == 'true' + run: npx playwright install-deps ${{ matrix.browser }} + - name: Run Playwright tests run: yarn test:browser:${{ matrix.browser }}