Skip to content

chore(github-tag): update tag actions/cache to v6 #637

chore(github-tag): update tag actions/cache to v6

chore(github-tag): update tag actions/cache to v6 #637

Workflow file for this run

---
name: E2E
# Runs the Playwright end-to-end + mobile/responsive suite. To keep PR feedback
# fast, pull requests run only the Chromium engine (desktop + emulated mobile);
# pushes to main and manual runs exercise the full matrix across Chromium,
# Firefox and WebKit (desktop) plus emulated mobile devices. Unit/component
# tests (Vitest) run in the Pages workflow; this workflow focuses on real
# browser flows. See playwright.config.js for projects and the dev web server.
on:
push:
branches:
- main
paths-ignore:
- "**.md"
pull_request:
types:
- opened
- synchronize
- reopened
paths-ignore:
- "**.md"
workflow_dispatch:
permissions:
contents: read
concurrency:
group: e2e-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
name: Playwright
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@d23441a48e516b6c34aea4fa41551a30e30af803 # v6.1.0
with:
persist-credentials: false
- name: Set up Node.js
uses: actions/setup-node@249970729cb0ef3589644e2896645e5dc5ba9c38 # v6.5.0
with:
# renovate: datasource=node-version depName=node
node-version: "24"
cache: npm
- name: Install dependencies
run: npm ci
- name: Determine browser scope
id: scope
# PRs validate against the Chromium engine only (desktop + mobile-chrome)
# for fast feedback; main / manual runs cover the full browser matrix.
run: |-
if [ "${{ github.event_name }}" = "pull_request" ]; then
{
echo "browsers=chromium"
echo "projects=--project=chromium --project=mobile-chrome"
echo "label=chromium"
} >> "$GITHUB_OUTPUT"
else
{
echo "browsers=chromium firefox webkit"
echo "projects="
echo "label=all"
} >> "$GITHUB_OUTPUT"
fi
- name: Resolve Playwright version
id: playwright-version
# Key the cache on the resolved Playwright version (stable across
# lockfile churn) rather than hashFiles(package-lock.json).
run: |-
version=$(node -p "require('./package-lock.json').packages['node_modules/@playwright/test'].version")
echo "version=$version" >> "$GITHUB_OUTPUT"
- name: Cache Playwright browsers
id: playwright-cache
uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/ms-playwright
key: >-
playwright-${{ runner.os }}-${{ steps.playwright-version.outputs.version }}-${{
steps.scope.outputs.label }}
- name: Install Playwright browsers
if: steps.playwright-cache.outputs.cache-hit != 'true'
env:
BROWSERS: ${{ steps.scope.outputs.browsers }}
run: |-
# shellcheck disable=SC2086 # intentional word splitting into args
npx playwright install $BROWSERS --with-deps
- name: Install Playwright system dependencies
# Browser binaries are cached, but apt system libraries are not persisted
# across ephemeral runners, so refresh them on a cache hit.
if: steps.playwright-cache.outputs.cache-hit == 'true'
env:
BROWSERS: ${{ steps.scope.outputs.browsers }}
run: |-
# shellcheck disable=SC2086 # intentional word splitting into args
npx playwright install-deps $BROWSERS
- name: Run Playwright tests
env:
PROJECTS: ${{ steps.scope.outputs.projects }}
run: |-
# shellcheck disable=SC2086 # intentional word splitting into args
npm run test:e2e -- $PROJECTS
- name: Upload Playwright report
if: ${{ !cancelled() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-report
path: playwright-report/
retention-days: 30
- name: Upload Playwright traces and results
if: ${{ failure() }}
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
with:
name: playwright-test-results
path: test-results/
retention-days: 30