diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 4fcbddaf..49083251 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -13,6 +13,13 @@ on: jobs: e2e: runs-on: ubuntu-24.04 + # Official Playwright image: browsers + system deps preinstalled, so no + # apt-based install step (slow apt mirrors were timing out WebKit deps in + # formkit/drag-and-drop#219). Keep the tag in sync with @playwright/test; + # the "Check Playwright image version" step enforces it. + container: + image: mcr.microsoft.com/playwright:v1.57.0-noble + options: --user 1001 steps: - name: Checkout uses: actions/checkout@v4 @@ -41,30 +48,17 @@ jobs: restore-keys: | ${{ runner.os }}-pnpm-store- - - name: Get Playwright version - id: playwright-version - run: echo "PLAYWRIGHT_VERSION=$(pnpm ls @playwright/test --json | jq -r '.[0].devDependencies."@playwright/test".version')" >> $GITHUB_OUTPUT - - - name: Cache Playwright browsers - id: playwright-cache - uses: actions/cache@v4 - with: - path: ~/.cache/ms-playwright - key: ${{ runner.os }}-playwright-${{ steps.playwright-version.outputs.PLAYWRIGHT_VERSION }} - restore-keys: | - ${{ runner.os }}-playwright- - - name: Install dependencies run: pnpm install --frozen-lockfile=false - - name: Install Playwright Browsers - if: steps.playwright-cache.outputs.cache-hit != 'true' - run: pnpm exec playwright install --with-deps - - - name: Install Playwright dependencies only - if: steps.playwright-cache.outputs.cache-hit == 'true' - run: pnpm exec playwright install-deps - + - name: Check Playwright image version + run: | + installed=$(node -p "require('@playwright/test/package.json').version") + if [ "$installed" != "1.57.0" ]; then + echo "::error::@playwright/test is $installed but the CI container is v1.57.0-noble. Update the image tag in main.yml." + exit 1 + fi + - name: Build project run: NO_NUXT=1 pnpm build