CI / test (push) Successful in 4m20s
self-hosted runner is pinned to homelab_proxy network (needed to resolve the gitea host for checkout), so job+service containers are separate network members, not sharing a netns like GitHub-hosted runners service containers do -- localhost inside the job container never reached the db service. Also drops the now-unneeded host port publish (avoids repeating the port-already-allocated failure an earlier orphaned run left behind). Co-Authored-By: Claude Sonnet 5 <[email protected]>
58 lines
1.7 KiB
YAML
58 lines
1.7 KiB
YAML
name: CI
|
|
|
|
on:
|
|
push:
|
|
branches: ["**"]
|
|
pull_request:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: ubuntu-latest
|
|
services:
|
|
db:
|
|
image: postgres:16-alpine
|
|
env:
|
|
POSTGRES_USER: asset_license_mgmt
|
|
POSTGRES_PASSWORD: change-me-local-dev
|
|
POSTGRES_DB: asset_license_mgmt
|
|
# No `ports:` publish to the host -- reached via the `db` hostname
|
|
# over homelab_proxy instead (see DATABASE_URL comment below), and
|
|
# skipping the host publish avoids a repeat of the "port already
|
|
# allocated" failure an earlier orphaned run's leftover container
|
|
# caused.
|
|
options: >-
|
|
--health-cmd pg_isready
|
|
--health-interval 5s
|
|
--health-timeout 5s
|
|
--health-retries 10
|
|
|
|
env:
|
|
# Hostname is the service key ("db"), NOT localhost -- the self-hosted
|
|
# runner is pinned to the homelab_proxy Docker network (so it can
|
|
# resolve the `gitea` host for checkout), which means job and service
|
|
# containers are separate network members rather than sharing a
|
|
# network namespace the way GitHub-hosted runners' service containers
|
|
# do. localhost inside the job container does not reach the service.
|
|
DATABASE_URL: postgres://asset_license_mgmt:change-me-local-dev@db:5432/asset_license_mgmt
|
|
AUTH_SECRET: ci-only-dummy-secret-not-used-in-prod
|
|
AUTH_TRUST_HOST: "true"
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 20
|
|
|
|
- run: npm ci
|
|
|
|
- run: npx prisma generate
|
|
|
|
- run: npx tsc --noEmit
|
|
|
|
- run: npm run lint
|
|
|
|
- run: npm test
|
|
|
|
- run: npm run build
|