Skip to content

canonicalize installed static archives #191

canonicalize installed static archives

canonicalize installed static archives #191

Workflow file for this run

name: ci
on:
push:
branches: [main]
pull_request:
branches: [main]
# Prefer tip-of-branch results when pushing frequently to main.
concurrency:
group: ci-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
test:
runs-on: ubuntu-latest
services:
postgres:
image: postgres:16-alpine
env:
POSTGRES_USER: zsql
POSTGRES_PASSWORD: zsql
POSTGRES_DB: zsql
ports:
- 5432:5432
options: >-
--health-cmd "pg_isready -U zsql -d zsql"
--health-interval 5s
--health-timeout 5s
--health-retries 10
steps:
# Node 24 action runtime (avoids Node 20 deprecation warnings).
- uses: actions/checkout@v5
# Install Zig without a Node-based action (setup-zig still targets Node 20).
# GITHUB_PATH only affects *later* steps, so put zig on PATH in-process too.
- name: Install Zig 0.16.0
run: |
set -euo pipefail
ZIG_VERSION=0.16.0
ZIG_DIR="/opt/zig-x86_64-linux-${ZIG_VERSION}"
URL="https://ziglang.org/download/${ZIG_VERSION}/zig-x86_64-linux-${ZIG_VERSION}.tar.xz"
curl -fsSL "$URL" -o /tmp/zig.tar.xz
sudo tar -xJf /tmp/zig.tar.xz -C /opt
test -x "${ZIG_DIR}/zig"
echo "${ZIG_DIR}" >> "$GITHUB_PATH"
export PATH="${ZIG_DIR}:${PATH}"
zig version
- name: Format check
run: zig fmt --check .
# Default package path must not require libc/sqlite. Never use std.c
# APIs that force libc linkage in code reachable without -Denable-sqlite.
- name: Build (default, no sqlite/libc)
run: zig build
- name: Clean-prefix install smoke
run: zig build install-smoke
- name: Test (default)
run: zig build test
- name: CLI doctor
run: zig build run -- doctor
- name: Offline checked-queries example
run: zig build checked-queries-example
- name: External consumer (core + bundled SQLite)
run: zig build consumer-smoke
- name: Postgres pool example (skips without ZSQL_PG_URL)
run: zig build run-postgres-pool-example
# Default SQLite path: bundled amalgamation (no system libsqlite3).
- name: Test with SQLite (amalgamation)
run: zig build test -Denable-sqlite=true
- name: SQLite example (amalgamation)
run: zig build run-sqlite-example -Denable-sqlite=true
- name: SQLite migration example (amalgamation)
run: zig build run-migration-example -Denable-sqlite=true
- name: CLI doctor with SQLite amalgamation
run: zig build run -Denable-sqlite=true -- doctor
# Optional system-lib path (keeps the escape hatch green).
- name: Install system SQLite
run: |
sudo apt-get update
sudo apt-get install -y libsqlite3-dev pkg-config
pkg-config --modversion sqlite3
- name: Test with SQLite (system)
run: zig build test -Denable-sqlite=true -Dsqlite-system=true
- name: External consumer (system SQLite)
run: zig build consumer-smoke-system
- name: Deterministic pre-tag aggregate
run: zig build release-verify
- name: Live PostgreSQL integration tests
env:
ZSQL_PG_URL: postgres://zsql:zsql@127.0.0.1:5432/zsql?sslmode=disable
run: zig build test-postgres
- name: Postgres pool example (live)
env:
ZSQL_PG_URL: postgres://zsql:zsql@127.0.0.1:5432/zsql?sslmode=disable
run: zig build run-postgres-pool-example