Some checks failed
CI / Lint & Typecheck (push) Successful in 3m49s
CI / Test (routes) (push) Successful in 1m43s
CI / Test (security) (push) Successful in 1m52s
CI / Test (services) (push) Successful in 1m25s
CI / Test (unit) (push) Successful in 2m0s
CI / Test (integration) (push) Successful in 3m42s
CI / Test Coverage (push) Failing after 2m13s
CI / Build (push) Has been skipped
173 lines
4.1 KiB
YAML
173 lines
4.1 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
pull_request:
|
|
types: [opened, synchronize]
|
|
|
|
jobs:
|
|
lint-and-typecheck:
|
|
name: Lint & Typecheck
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
timeout-minutes: 10
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable pnpm
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Lint
|
|
run: pnpm lint
|
|
|
|
- name: Typecheck
|
|
run: pnpm typecheck
|
|
|
|
test:
|
|
name: Test (${{ matrix.group }})
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
timeout-minutes: 15
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
|
|
strategy:
|
|
fail-fast: false
|
|
matrix:
|
|
group: [unit, services, routes, security]
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable pnpm
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build dependencies (shared, test-utils)
|
|
run: pnpm turbo run build --filter=@tracearr/shared --filter=@tracearr/test-utils
|
|
|
|
- name: Run ${{ matrix.group }} tests
|
|
run: pnpm --filter @tracearr/server test:${{ matrix.group }}
|
|
|
|
test-integration:
|
|
name: Test (integration)
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
timeout-minutes: 15
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
TEST_DATABASE_URL: postgresql://test:test@timescale:5432/tracearr_test
|
|
TEST_REDIS_URL: redis://redis:6379
|
|
|
|
services:
|
|
timescale:
|
|
image: timescale/timescaledb:latest-pg15
|
|
env:
|
|
POSTGRES_USER: test
|
|
POSTGRES_PASSWORD: test
|
|
POSTGRES_DB: tracearr_test
|
|
options: >-
|
|
--health-cmd "pg_isready -U test -d tracearr_test"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 10
|
|
|
|
redis:
|
|
image: redis:7-alpine
|
|
options: >-
|
|
--health-cmd "redis-cli ping"
|
|
--health-interval 5s
|
|
--health-timeout 3s
|
|
--health-retries 5
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable pnpm
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build dependencies (shared, test-utils)
|
|
run: pnpm turbo run build --filter=@tracearr/shared --filter=@tracearr/test-utils
|
|
|
|
- name: Run integration tests
|
|
run: pnpm --filter @tracearr/server test:integration
|
|
|
|
test-coverage:
|
|
name: Test Coverage
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
timeout-minutes: 15
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable pnpm
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build dependencies (shared, test-utils)
|
|
run: pnpm turbo run build --filter=@tracearr/shared --filter=@tracearr/test-utils
|
|
|
|
- name: Run tests with coverage
|
|
run: pnpm test:coverage
|
|
|
|
- name: Upload coverage reports
|
|
uses: actions/upload-artifact@v4
|
|
if: always()
|
|
with:
|
|
name: coverage-report
|
|
path: apps/server/coverage/
|
|
retention-days: 7
|
|
if-no-files-found: warn
|
|
|
|
build:
|
|
name: Build
|
|
runs-on: ubuntu-latest
|
|
container:
|
|
image: node:22-bookworm
|
|
timeout-minutes: 15
|
|
needs:
|
|
- lint-and-typecheck
|
|
- test
|
|
- test-integration
|
|
- test-coverage
|
|
env:
|
|
TURBO_TOKEN: ${{ secrets.TURBO_TOKEN }}
|
|
TURBO_TEAM: ${{ vars.TURBO_TEAM }}
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Enable pnpm
|
|
run: corepack enable
|
|
|
|
- name: Install dependencies
|
|
run: pnpm install --frozen-lockfile
|
|
|
|
- name: Build
|
|
run: pnpm build
|