Skip to content

perf(component): render initial diff during SSR #32

perf(component): render initial diff during SSR

perf(component): render initial diff during SSR #32

Workflow file for this run

name: Run tests
permissions:
contents: read
on:
workflow_call:
pull_request:
branches:
- main
- '!dependabot/**'
paths:
- src/**
- tests/**
- '!docs/**'
- package.json
- package-lock.json
- svelte.config.*
- vite.config.*
- playwright.config.*
- tsconfig*.json
- .github/workflows/run-tests.yml
concurrency:
group: run-tests-${{ github.ref }}
cancel-in-progress: true
jobs:
unit-tests:
runs-on: blacksmith-2vcpu-ubuntu-2404 # trunk-ignore(actionlint/runner-label)
timeout-minutes: 10
steps:
- name: Checkout
uses: actions/checkout@v7 # zizmor: ignore[unpinned-uses]
with:
persist-credentials: false
fetch-depth: 1
- uses: pnpm/action-setup@v6 # zizmor: ignore[unpinned-uses]
- name: Use Node.js - 24
uses: actions/setup-node@v7 # zizmor: ignore[unpinned-uses]
with:
node-version: 24
- name: Cache build artifacts
uses: actions/cache@v6 # zizmor: ignore[unpinned-uses]
with:
path: |
.svelte-kit
dist
key: ${{ runner.os }}-build-${{ hashFiles('src/**/*', 'pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-build-
- name: Cache vitest artifacts
uses: actions/cache@v6 # zizmor: ignore[unpinned-uses]
with:
path: |
node_modules/.vitest
test-results
key: ${{ runner.os }}-vitest-${{ hashFiles('pnpm-lock.yaml', 'src/**/*.{test,spec}.{js,ts}', 'tests/**/*.{test,spec}.{js,ts}', 'vitest.config.ts') }}
restore-keys: |
${{ runner.os }}-vitest-
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Run unit tests
run: |
pnpm build
pnpm test
- name: Upload unit test results
if: always()
uses: actions/upload-artifact@v7 # zizmor: ignore[unpinned-uses]
with:
name: unit-test-results
path: |
coverage/**
test-results/**
if-no-files-found: ignore
retention-days: 7
e2e-tests:
needs: unit-tests
runs-on: blacksmith-2vcpu-ubuntu-2404 # trunk-ignore(actionlint/runner-label)
timeout-minutes: 25
strategy:
fail-fast: false
matrix:
include:
- shard: 1/2
shard_name: 1-2
- shard: 2/2
shard_name: 2-2
steps:
- name: Checkout
uses: actions/checkout@v7 # zizmor: ignore[unpinned-uses]
with:
persist-credentials: false
fetch-depth: 1
- uses: pnpm/action-setup@v6 # zizmor: ignore[unpinned-uses]
- name: Use Node.js - 24
uses: actions/setup-node@v7 # zizmor: ignore[unpinned-uses]
with:
node-version: 24
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Cache Playwright browsers
uses: actions/cache@v6 # zizmor: ignore[unpinned-uses]
with:
path: ~/.cache/ms-playwright
key: ${{ runner.os }}-playwright-${{ hashFiles('pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-playwright-
- name: Install Playwright browsers
run: pnpm exec playwright install --with-deps
- name: Sanity check - list discovered tests
run: pnpm exec playwright test --list | head -n 50 | cat
- name: Run e2e tests (sharded)
env:
CI: true
run: pnpm exec playwright test --config=playwright.config.ts --shard=${{ matrix.shard }} --reporter=line
- name: Upload Playwright artifacts
if: always()
uses: actions/upload-artifact@v7 # zizmor: ignore[unpinned-uses]
with:
name: playwright-artifacts-${{ matrix.shard_name }}
path: |
playwright-report/**
test-results/**
blob-report/**
if-no-files-found: ignore
retention-days: 7