Files
dbis_core/.github/workflows/ci.yml
defiQUG 8da6bd8b2a
Some checks failed
CI / test (push) Failing after 6m51s
CI / security (push) Failing after 2m9s
CI / build (push) Failing after 3m34s
fix(ci): use postgres service hostname for DATABASE_URL on containerized runners
Gitea act_runner runs jobs in Docker; use the services: postgres hostname, not localhost.

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-05-11 21:05:25 -07:00

107 lines
2.3 KiB
YAML

name: CI
on:
push:
branches: [main, develop]
pull_request:
branches: [main, develop]
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:15
env:
POSTGRES_USER: test
POSTGRES_PASSWORD: test
POSTGRES_DB: dbis_test
options: >-
--health-cmd pg_isready
--health-interval 10s
--health-timeout 5s
--health-retries 5
ports:
- 5432:5432
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate Prisma Client
run: npx prisma generate
- name: Run linter
run: npm run lint
- name: Type check
run: npx tsc --noEmit
# Hostname must match `services:` id. `localhost` breaks Gitea act_runner (Docker job).
- name: Run tests
env:
DATABASE_URL: postgresql://test:test@postgres:5432/dbis_test
JWT_SECRET: test-jwt-secret-minimum-32-characters-long-for-testing
ALLOWED_ORIGINS: http://localhost:3000
NODE_ENV: test
run: npm test -- --coverage
- name: Upload coverage
uses: codecov/codecov-action@v3
with:
files: ./coverage/lcov.info
fail_ci_if_error: false
security:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Run security audit
run: npm audit --audit-level=moderate
- name: Check for vulnerabilities
run: npm audit --audit-level=high || true
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Generate Prisma Client
run: npx prisma generate
- name: Build
run: npm run build
- name: Check build output
run: test -d dist