Selaa lähdekoodia

Enhance Playwright workflow with version retrieval and caching for improved performance

codecalm 6 kuukautta sitten
vanhempi
commit
c2b446c209
1 muutettua tiedostoa jossa 14 lisäystä ja 1 poistoa
  1. 14 1
      .github/workflows/playwright.yml

+ 14 - 1
.github/workflows/playwright.yml

@@ -39,11 +39,24 @@ jobs:
       - name: Install PNPM
         uses: pnpm/action-setup@v4
 
+      - name: Get installed Playwright version
+        id: playwright-version
+        run: echo "PLAYWRIGHT_VERSION=$(node -e "console.log(require('./package-lock.json').dependencies['@playwright/test'].version)")" >> $GITHUB_ENV
+
+      - name: Cache playwright binaries
+        uses: actions/cache@v3
+        id: playwright-cache
+        with:
+          path: |
+            ~/.cache/ms-playwright
+          key: ${{ runner.os }}-playwright-${{ env.PLAYWRIGHT_VERSION }}
+
       - name: Install pnpm dependencies
         run: pnpm install
 
       - name: Install Playwright Browsers
-        run: pnpm exec playwright install   
+        run: pnpm exec playwright install --with-deps
+        if: steps.playwright-cache.outputs.cache-hit != 'true'
 
       - name: Run Playwright tests
         run: pnpm run playwright