Skip to content

Better params schema validation #1227

Better params schema validation

Better params schema validation #1227

name: Runs E2E API Tests
on:
push:
branches:
- dev
- main
pull_request:
branches:
- dev
- main
jobs:
build:
runs-on: ubuntu-latest
env:
NODE_ENV: test
strategy:
matrix:
node-version: [20.x]
steps:
- uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Setup pnpm
uses: pnpm/action-setup@v3
with:
version: 9.1.2
- name: Install dependencies
run: pnpm install --frozen-lockfile
- name: Create .env.test.local file for stack-backend
run: cp apps/backend/.env.development apps/backend/.env.test.local
- name: Create .env.test.local file for stack-dashboard
run: cp apps/dashboard/.env.development apps/dashboard/.env.test.local
- name: Build stack-backend
run: pnpm build:backend
- name: Build stack-dashboard
run: pnpm build:dashboard
- name: Start Docker Compose
run: docker-compose -f dependencies.compose.yaml up -d
- name: Wait on Postgres
run: npx wait-on tcp:localhost:5432
- name: Wait on Inbucket
run: npx wait-on tcp:localhost:2500
- name: Initialize database
run: pnpm run prisma -- migrate reset --force
- name: Start stack-backend in background
uses: JarvusInnovations/[email protected]
with:
run: pnpm run start:backend --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true
- name: Start stack-dashboard in background
uses: JarvusInnovations/[email protected]
with:
run: pnpm run start:dashboard --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true
- name: Start oauth-mock-server in background
uses: JarvusInnovations/[email protected]
with:
run: pnpm run start:oauth-mock-server --log-order=stream &
wait-on: |
http://localhost:8102
tail: true
wait-for: 30s
log-output-if: true
- name: Run tests
run: pnpm test
- name: Run tests again, to make sure they are stable (attempt 1)
run: pnpm test
- name: Run tests again, to make sure they are stable (attempt 2)
run: pnpm test
- name: Run tests again, to make sure they are stable (attempt 3)
run: pnpm test
- name: Print Docker Compose logs
if: always()
run: docker-compose -f dependencies.compose.yaml logs