All checks were successful
CI / test (push) Successful in 9m54s
deploy.yaml, which tested main, is gone. Assisted-by: Claude:opus-5-5
69 lines
2.4 KiB
YAML
69 lines
2.4 KiB
YAML
name: CI
|
|
|
|
# Every push: tests, gemset.nix in step with Gemfile.lock, and the package
|
|
# the servers run. Deploying is not this repository's job: Renovate in
|
|
# asxpi/iac picks up each push to main and the servers pull it (comin).
|
|
on:
|
|
push:
|
|
|
|
jobs:
|
|
test:
|
|
runs-on: nix-latest
|
|
# Settings via env, not /etc/nix/nix.conf: in the image that is a
|
|
# symlink into /nix/store, which the runner's nix-store volume
|
|
# shadows, so it dangles once the image moves on.
|
|
env:
|
|
NIX_CONFIG: |
|
|
experimental-features = nix-command flakes
|
|
build-users-group =
|
|
sandbox = false
|
|
services:
|
|
# CI stand-in for bin/test's ephemeral Postgres: the nix container runs
|
|
# as root and initdb refuses to run as root, so the DB lives in a
|
|
# service container instead and the suite connects via TEST_DATABASE_URL.
|
|
# Job and service share the per-workflow bridge network (the runner's
|
|
# container.network must stay "" — with "host" the service network is
|
|
# never created and services fail to start).
|
|
postgres:
|
|
image: postgres:18.7-alpine
|
|
env:
|
|
POSTGRES_USER: postgres
|
|
POSTGRES_HOST_AUTH_METHOD: trust
|
|
POSTGRES_DB: bingo_test
|
|
steps:
|
|
- name: Prepare container for actions
|
|
run: |
|
|
# node for JS actions (checkout); git-minimal is already in the image
|
|
nix-env -iA nixpkgs.nodejs_22
|
|
|
|
- name: Checkout
|
|
uses: actions/checkout@v7.0.1
|
|
|
|
# The nix closure persists in the runner's nix-store volume; gems live
|
|
# in the workspace (.gems via the flake's BUNDLE_PATH), so cache those.
|
|
- name: Cache gems
|
|
uses: actions/cache@v6.1.0
|
|
with:
|
|
path: .gems
|
|
key: gems-${{ hashFiles('Gemfile.lock') }}
|
|
|
|
- name: Wait for Postgres
|
|
run: |
|
|
for i in $(seq 1 30); do
|
|
nix develop -c pg_isready -h postgres -U postgres && exit 0
|
|
sleep 2
|
|
done
|
|
echo "Postgres service never became ready" >&2
|
|
exit 1
|
|
|
|
- name: Run test suite
|
|
env:
|
|
TEST_DATABASE_URL: postgres://postgres@postgres:5432/bingo_test
|
|
run: nix develop -c bundle exec rake test
|
|
|
|
# What the servers run: gemset.nix in step with Gemfile.lock, and
|
|
# the package builds
|
|
- name: Package
|
|
run: |
|
|
nix develop -c ruby bin/check-gemset
|
|
nix build .#default
|