mirror of
https://github.com/mauriceboe/TREK.git
synced 2026-06-19 13:21:46 +00:00
100 lines
2.2 KiB
YAML
100 lines
2.2 KiB
YAML
name: Tests
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
branches: [main, dev]
|
|
paths:
|
|
- 'server/**'
|
|
- 'client/**'
|
|
- 'shared/**'
|
|
- '.github/workflows/test.yml'
|
|
|
|
jobs:
|
|
shared-contracts:
|
|
name: Shared Contracts (Zod)
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --workspace shared
|
|
|
|
- name: Typecheck
|
|
run: cd shared && npm run typecheck
|
|
|
|
- name: Run tests
|
|
run: cd shared && npm test
|
|
|
|
server-tests:
|
|
name: Server Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --workspace server
|
|
|
|
- name: Build (tsc + tsc-alias -> dist)
|
|
run: cd server && npm run build
|
|
|
|
- name: Typecheck (informational)
|
|
# Legacy code still has pre-existing type errors; this surfaces them
|
|
# without blocking the migration. Ratchet to blocking once cleaned up.
|
|
continue-on-error: true
|
|
run: cd server && npm run typecheck
|
|
|
|
- name: Run tests
|
|
run: cd server && npm run test:coverage
|
|
|
|
- name: Upload coverage
|
|
if: success()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: backend-coverage
|
|
path: server/coverage/
|
|
retention-days: 7
|
|
|
|
client-tests:
|
|
name: Client Tests
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- uses: actions/checkout@v6
|
|
|
|
- uses: actions/setup-node@v6
|
|
with:
|
|
node-version: 24
|
|
cache: npm
|
|
cache-dependency-path: package-lock.json
|
|
|
|
- name: Install dependencies
|
|
run: npm ci --workspace client
|
|
|
|
- name: Run tests
|
|
run: cd client && npm run test:coverage
|
|
|
|
- name: Upload coverage
|
|
if: success()
|
|
uses: actions/upload-artifact@v6
|
|
with:
|
|
name: frontend-coverage
|
|
path: client/coverage/
|
|
retention-days: 7
|