# SPDX-License-Identifier: AGPL-3.0-or-later # Runs on GitHub Actions and Gitea/Forgejo Actions (both read .github/workflows). name: ci on: push: pull_request: jobs: check: runs-on: ubuntu-latest # Run in a container so the service is reachable by its name ("postgres") on every runner: # GitHub's hosted runners only give services a DNS name inside container jobs. container: node:24 services: postgres: image: postgres:18-alpine env: POSTGRES_USER: selfphoneng POSTGRES_PASSWORD: ci POSTGRES_DB: selfphoneng options: >- --health-cmd "pg_isready -U selfphoneng" --health-interval 5s --health-retries 20 env: TEST_DATABASE_URL: postgres://selfphoneng:ci@postgres:5432/selfphoneng steps: - uses: actions/checkout@v7 - uses: pnpm/action-setup@v6 # version comes from package.json "packageManager" # Sound and greeting tests convert real audio (skipped without ffmpeg). - run: apt-get update -qq && apt-get install -y -qq --no-install-recommends ffmpeg - run: pnpm install --frozen-lockfile - run: pnpm lint - run: pnpm typecheck - run: pnpm test images: runs-on: ubuntu-latest steps: - uses: actions/checkout@v7 - run: docker build -f apps/api/Dockerfile -t selfphoneng-api:ci . # Loads every module the way the container does: catches files tsc doesn't copy into dist. - run: docker run --rm --entrypoint node selfphoneng-api:ci --input-type=module -e "await import('/app/dist/app.js')" - run: docker build -t selfphoneng-asterisk:ci asterisk