Skip to content

initial commit

initial commit #3

Workflow file for this run

name: Tests
permissions:
contents: read
pull-requests: write
on:
push:
branches:
- main
paths:
- "src/**"
- "tests/**"
- "pnpm-lock.yaml"
- ".github/workflows/tests.yml"
pull_request:
paths:
- "src/**"
- "tests/**"
- "pnpm-lock.yaml"
- ".github/workflows/tests.yml"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
browser: [webkit, firefox, chromium]
steps:
- uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
- uses: pnpm/action-setup@a7487c7e89a18df4991f7f222e4898a00d66ddda # v4.1.0
with:
version: 10
run_install: false
- uses: actions/setup-node@49933ea5288caeca8642d1e84afbd3f7d6820020 # v4.4.0
with:
node-version: 22
cache: "pnpm"
- uses: actions/cache@5a3ec84eff668545956fd18022155c47e93e2684 # v4.2.3
id: playwright-cache
with:
path: |
~/.cache/ms-playwright
key: ${{ runner.os }}-${{ matrix.browser }}-playwright-${{ hashFiles('**/pnpm-lock.yaml') }}
- name: Install deps
run: pnpm install --frozen-lockfile
- name: Type Check
run: pnpm ts
- name: Run unit tests
run: pnpm vitest run --coverage
- run: pnpm exec playwright install --with-deps ${{ matrix.browser }}
if: steps.playwright-cache.outputs.cache-hit != 'true'
- run: pnpm exec playwright install-deps ${{ matrix.browser }}
if: steps.playwright-cache.outputs.cache-hit == 'true'
- name: Build
run: pnpm vite build
- name: Run e2e tests
run: pnpm playwright test --project="${{ matrix.browser }}"
- name: Coverage
uses: davelosert/vitest-coverage-report-action@8ab049ff5a2c6e78f78af446329379b318544a1a # v2.8.3
if: ${{ matrix.browser == 'webkit' && success() }}