67 lines
1.7 KiB
YAML
67 lines
1.7 KiB
YAML
name: Tests
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
branches: [main]
|
|
|
|
# Cancel superseded runs on the same ref (e.g. new pushes to a PR).
|
|
concurrency:
|
|
group: tests-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
jobs:
|
|
unit:
|
|
name: Unit (happy-dom)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 11
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
- run: pnpm test
|
|
|
|
e2e:
|
|
name: E2E (Chromium + Firefox + WebKit)
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 11
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
# Downloads the browser binaries and their OS libraries (Firefox/WebKit
|
|
# need system deps that `--with-deps` installs via apt on the runner).
|
|
- name: Install Playwright browsers
|
|
run: pnpm exec playwright install --with-deps chromium firefox webkit
|
|
- run: pnpm test:e2e:all
|
|
|
|
size:
|
|
name: Size limit
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
- uses: pnpm/action-setup@v4
|
|
with:
|
|
version: 11
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version-file: .nvmrc
|
|
cache: pnpm
|
|
- run: pnpm install --frozen-lockfile
|
|
# `pnpm size-limit` builds `dist/` (tsc + esbuild) and checks each entry
|
|
# against the byte budgets declared in package.json `size-limit`.
|
|
- run: pnpm size-limit
|