From 1b4a52aaa13685d2c7bf9ae3132540c2e02d98b3 Mon Sep 17 00:00:00 2001 From: shamoon <4887959+shamoon@users.noreply.github.com> Date: Thu, 1 May 2025 22:51:52 -0700 Subject: [PATCH] Development: always try playwright install on ci, cache browsers (#9847) --- .github/workflows/ci.yml | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 83cbce290..e29f883bd 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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