#!/bin/sh # CI of louise-lang/packages: what a pull request waits on, and what main # and the nightly run check. Run it locally the same way. # # scripts/ci.sh the packages scripts/affected.sh selects # LOUISE_CI_ALL=1 scripts/ci.sh every package (main, nightly) # # Needs louise on PATH (the toolchain step installs the pinned release) and a # C compiler for the native tests. Optional: # LOUISE_PG_URL a PostgreSQL for postgres, eventsourcing and throttle's # live tests, which skip without it # LOUISE_NET_TESTS loopback socket tests (set here for postgres and fetch) set -eu cd "$(dirname "$0")/.." step() { printf '\n== %s\n' "$*"; } if [ "${LOUISE_CI_ALL:-0}" = 1 ]; then selected=$(for m in */louise.toml; do dirname "$m"; done) else selected=$(scripts/affected.sh "${LOUISE_CI_BASE:-origin/main}") fi if [ -z "$selected" ]; then echo "ci: no package changed" exit 0 fi echo "ci: $(echo $selected)" step "formatting" louise fmt --check $selected step "released packages are well formed" scripts/check-manifests.sh $selected for pkg in $selected; do step "$pkg" ( cd "$pkg" louise check --deny-warnings --locked case "$pkg" in # C bindings whose tests only run natively. argon2 | stringzilla | vectors) louise test --native --locked ;; # Their PostgreSQL tests share a database: one at a time. throttle | eventsourcing) louise test --locked && louise test --native --locked --jobs 1 ;; # Deterministic loopback and wire tests, native only. postgres | fetch) louise test --locked && LOUISE_NET_TESTS=1 louise test --native --locked ;; *) louise test --locked && louise test --native --locked ;; esac ) rm -rf "$pkg/build" done echo echo "ci: all checks passed"