Skip to content

ci: speed up e2e workflow #316

ci: speed up e2e workflow

ci: speed up e2e workflow #316

Workflow file for this run

name: E2E Tests
on:
pull_request:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: e2e-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
e2e:
runs-on: ubuntu-latest
timeout-minutes: 45
steps:
- name: Checkout
uses: actions/checkout@v6
- name: Setup Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: latest
- name: Cache Bun install + node_modules
uses: actions/cache@v4
with:
path: |
~/.bun/install/cache
node_modules
key: ${{ runner.os }}-bun-${{ hashFiles('bun.lock') }}
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v4
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('bun.lock') }}
- name: Install Playwright browsers
run: |
if [ "${{ github.event_name }}" = "pull_request" ]; then
bunx playwright install chromium --with-deps
else
bunx playwright install --with-deps
fi
- name: Build app
run: bun run build
- name: Run E2E tests (headless)
env:
CI: true
# Speed default on PRs: chromium only. Full cross-browser can be run via workflow_dispatch.
E2E_BROWSERS: ${{ github.event_name == 'pull_request' && 'chromium' || 'chromium,firefox,webkit' }}
run: bun run test:e2e
- name: Upload Playwright HTML report
if: always()
uses: actions/upload-artifact@v6
with:
name: playwright-report
path: playwright-report/
if-no-files-found: ignore