Skip to content

Better E2E testing, dev mode/HMR tests #42

Better E2E testing, dev mode/HMR tests

Better E2E testing, dev mode/HMR tests #42

Workflow file for this run

name: E2E Tests
on:
# TODO remove once we know this action is working correctly
push:
branches: [test/2255-hmr-tests]
pull_request:
branches: [main, next]
jobs:
find-e2e-test-projects:
name: Find E2E Test Projects
runs-on: ubuntu-latest
outputs:
e2e-test-projects: ${{ steps.e2e-test-projects.outputs.e2e-test-projects }}
steps:
- uses: actions/checkout@v4
- id: e2e-test-projects
run: echo "e2e-test-projects=$(find e2e -maxdepth 1 -type d -printf "%f\n" | jq --raw-input --slurp --compact-output 'split("\n")[1:-1]')" >> ${GITHUB_OUTPUT}
run-tests:
needs:
- find-e2e-test-projects
strategy:
fail-fast: false
matrix:
project: ${{ fromJson(needs.find-e2e-test-projects.outputs.e2e-test-projects) }}
os: [ubuntu-latest, maxOS-latest, windows-latest]
node-version: [18, 20]
name: e2e/${{ matrix.project }}/${{ matrix.os }}/node-${{ matrix.node-version}}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout Repo
uses: actions/checkout@v4
- name: Action Setup (pnpm)
uses: pnpm/action-setup@v4
with:
version: 8
- name: Setup Node
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
cache: pnpm
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Install Playwright and browsers
run: pnpm playwright install --with-deps
- name: Run dev mode tests
working-directory: ./e2e/${{ matrix.project }}
run: pnpm run test:dev
- name: Build
working-directory: ./e2e/${{ matrix.project }}
run: pnpm run build
- name: Run preview mode tests
working-directory: ./e2e/${{ matrix.project }}
run: pnpm run test:preview
- name: Upload Playwright reports
if: always()
uses: actions/upload-artifact@v4
with:
name: e2e_${{ matrix.project }}_${{ matrix.os }}_node-${{ matrix.node-version }}_playwright-reports
path: e2e/${{ matrix.project }}/playwright-reports