Files
networking-toolbox/.github/workflows/tests.yml
T

62 lines
1.4 KiB
YAML

name: 🧪 Run Tests
on:
pull_request:
push:
branches: [main]
concurrency:
group: ci-${{ github.ref }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
kind: [unit, e2e]
env:
NODE_OPTIONS: "--max_old_space_size=8192"
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
cache: npm
- name: Install deps
run: npm ci
# --- Unit (Vitest) ---
- name: Run unit tests (Vitest + coverage)
if: matrix.kind == 'unit'
run: npm run test:coverage
- name: Upload unit coverage
if: matrix.kind == 'unit' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: coverage-unit
path: coverage
if-no-files-found: ignore
# --- E2E (Playwright) ---
- name: Install Playwright browsers
if: matrix.kind == 'e2e'
run: npx playwright install --with-deps
- name: Run e2e tests (Playwright)
if: matrix.kind == 'e2e'
run: npm run test:e2e -- --reporter=junit,html
- name: Upload e2e reports
if: matrix.kind == 'e2e' && (success() || failure())
uses: actions/upload-artifact@v4
with:
name: playwright-report
path: |
playwright-report
test-results
if-no-files-found: ignore