]> git.ipfire.org Git - thirdparty/paperless-ngx.git/commitdiff
Development: always try playwright install on ci, cache browsers (#9847)
authorshamoon <4887959+shamoon@users.noreply.github.com>
Fri, 2 May 2025 05:51:52 +0000 (22:51 -0700)
committershamoon <4887959+shamoon@users.noreply.github.com>
Fri, 2 May 2025 06:34:21 +0000 (23:34 -0700)
.github/workflows/ci.yml

index 83cbce2904d06d30231a27600d228a33ddd04978..e29f883bd7488f095974a396b23309fe580448da 100644 (file)
@@ -177,12 +177,19 @@ jobs:
             ~/.pnpm-store
             ~/.cache
           key: ${{ runner.os }}-frontenddeps-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
+      - name: Cache Playwright browsers
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/ms-playwright
+          key: ${{ runner.os }}-playwright-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
+          restore-keys: |
+            ${{ runner.os }}-playwright-
+      - name: Install Playwright system dependencies
+        run: npx playwright install-deps
       - name: Install dependencies
-        if: steps.cache-frontend-deps.outputs.cache-hit != 'true'
         run: cd src-ui && pnpm install
-      - name: Install Playwright
-        if: steps.cache-frontend-deps.outputs.cache-hit != 'true'
-        run: cd src-ui && pnpm playwright install --with-deps
+      - name: Install Playwright and Browsers
+        run: cd src-ui && pnpm exec playwright install
   tests-frontend:
     name: "Frontend Tests (Node ${{ matrix.node-version }} - ${{ matrix.shard-index }}/${{ matrix.shard-count }})"
     runs-on: ubuntu-24.04
@@ -220,6 +227,13 @@ jobs:
         run: cd src-ui && pnpm run lint
       - name: Run Jest unit tests
         run: cd src-ui && pnpm run test --max-workers=2 --shard=${{ matrix.shard-index }}/${{ matrix.shard-count }}
+      - name: Cache Playwright browsers
+        uses: actions/cache@v4
+        with:
+          path: ~/.cache/ms-playwright
+          key: ${{ runner.os }}-playwright-${{ hashFiles('src-ui/pnpm-lock.yaml') }}
+          restore-keys: |
+            ${{ runner.os }}-playwright-
       - name: Run Playwright e2e tests
         run: cd src-ui && pnpm exec playwright test --shard ${{ matrix.shard-index }}/${{ matrix.shard-count }}
       - name: Upload frontend test results to Codecov