diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 652e5de..f56c88f 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -25,10 +25,24 @@ jobs: node-version: 18 cache: pnpm + - name: Store Playwright's Version + run: | + PLAYWRIGHT_VERSION=$(npm ls @playwright/test | grep @playwright | sed 's/.*@//') + echo "Playwright's Version: $PLAYWRIGHT_VERSION" + echo "PLAYWRIGHT_VERSION=$PLAYWRIGHT_VERSION" >> $GITHUB_ENV + + - name: Cache Playwright Browsers for Playwright's Version + id: cache-playwright-browsers + uses: actions/cache@v3 + with: + path: ~/.cache/ms-playwright + key: playwright-browsers-${{ env.PLAYWRIGHT_VERSION }} + - name: Install dependencies run: pnpm install - name: Install playwright browsers + if: steps.cache-playwright-browsers.outputs.cache-hit != 'true' run: npx playwright install --with-deps - name: Run tests