wcb/.github/workflows/test.yml
Ayo 6af7598973
Some checks are pending
Tests / Unit (happy-dom) (push) Waiting to run
Tests / E2E (Chromium + Firefox + WebKit) (push) Waiting to run
Tests / Size limit (push) Waiting to run
chore: add github test actions
2026-07-05 16:10:35 +02:00

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