Files
HealthLog/.github/workflows/integration.yml
T

53 lines
2.1 KiB
YAML

name: Integration tests
on:
pull_request:
branches: [main]
push:
branches: [main]
permissions:
contents: read
jobs:
integration:
runs-on: ubuntu-latest
# This guard exists to kill a hung testcontainer or a deadlocked query, not
# to hold the suite to a performance budget. At 15 it had stopped telling
# those apart: the suite itself takes around 13 minutes of job time (128
# files against a real Postgres), so two consecutive runs of the SAME
# commit range came in at 12m50s and then over 15m, and the second was
# killed mid-run with every test to that point green. A cap that a healthy
# run clears only on a fast runner reports runner weather, not health.
# 25 leaves real headroom and still catches a hang inside one CI cycle.
# If the suite ever approaches this number, split it rather than raise it.
timeout-minutes: 25
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
- uses: pnpm/action-setup@0ebf47130e4866e96fce0953f49152a61190b271 # v6.0.9
- uses: actions/setup-node@820762786026740c76f36085b0efc47a31fe5020 # v7.0.0
with:
node-version: 22
cache: pnpm
- run: pnpm install --frozen-lockfile
- run: pnpm db:generate
- run: pnpm test:integration
env:
# The integration suite boots a Postgres testcontainer and points
# Prisma at it via DATABASE_URL set inside `tests/integration/setup.ts`.
# These env vars satisfy code paths that read them at module load.
#
# ENCRYPTION_KEY MUST be quoted: YAML 1.2 parses an unquoted run of
# zeros as the integer 0, which then arrives in `process.env` as the
# string "0" — failing crypto's hex/base64 length check and breaking
# the backups + integration-status suites for 50+ runs (regression
# since v1.4.13). Quoting forces a literal scalar.
API_TOKEN_HMAC_KEY: "dddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddddd"
ENCRYPTION_KEY: "0000000000000000000000000000000000000000000000000000000000000000"
SESSION_SECRET: "integration-tests"