Files
runners-calendar/.github/workflows/ci.yml
T

51 lines
1.3 KiB
YAML

name: CI
on:
pull_request:
branches: [main]
types: [edited]
jobs:
build-and-test:
if: >-
contains(github.event.pull_request.body, format('CI-Head: {0}', github.event.pull_request.head.sha))
runs-on: ubuntu-latest
container: node:20-bookworm
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_DB: calendar_run_test
POSTGRES_USER: postgres
POSTGRES_PASSWORD: postgres
options: >-
--health-cmd "pg_isready -U postgres -d calendar_run_test"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
- uses: actions/checkout@v4
with:
persist-credentials: false
- name: Backend — install, build, test
working-directory: backend
env:
NODE_ENV: test
DB_HOST: postgres
DB_PORT: "5432"
DB_NAME: calendar_run_test
DB_USER: postgres
DB_PASSWORD: postgres
SESSION_SECRET: test-session-secret
TURNSTILE_BYPASS_TOKEN: mock-turnstile-token
run: |
npm ci
npm run build
npm test
- name: Frontend — install, build
working-directory: frontend
run: |
npm ci
npm run build