Skip to content

verify-extensions

verify-extensions #179

name: verify-extensions
# Catches two classes of AILANG version drift:
#
# 1. "Pin drift" (PR #16): AILANG_REF in install-prerequisites.sh lagged
# behind what extensions actually required.
#
# 2. "Dev-build gap" (PR #33): PR was verified locally against a dev build
# (v0.21.0-99-g...) while the released v0.22.0 had stricter type
# checking that caught a missing ExtCtx.context_limit field.
#
# Fix: CI derives the AILANG version to build from ailang.toml's floor
# constraint (e.g. `ailang = ">=0.22.0"` → build v0.22.0). The floor and
# AILANG_REF in install-prerequisites.sh must both be kept in sync — a
# mismatch causes this job to fail on the "versions must match" check.
on:
# Run on EVERY PR (no paths filter). check_core type-checks all of src/**
# against freshly-resolved registry deps, so a regression can come from a
# source-only change OR from an upstream extension bump (e.g. motoko_ext_abi
# adding a field to ExtCtx) that changes NO file in the PR. A paths filter
# silently skipped those cases, so the maintainer became our smoke test.
pull_request:
push:
branches: [main]
# Nightly: catch upstream registry-dependency drift that breaks check_core
# with no commit at all (the abi 2.2.0 / context_limit class of failure).
schedule:
- cron: '0 6 * * *'
workflow_dispatch:
concurrency:
group: verify-extensions-${{ github.ref }}
cancel-in-progress: true
jobs:
verify_extensions:
name: verify_extensions + check_core + smoke_no_delegated_storm
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Read AILANG floor from ailang.toml (single source of truth)
id: pin
run: |
# Parse floor from: ailang = ">=X.Y.Z"
version=$(grep -E '^ailang\s*=' ailang.toml | grep -oE '[0-9]+\.[0-9]+\.[0-9]+' | head -n1)
if [[ -z "$version" ]]; then
echo "::error::Could not parse ailang floor from ailang.toml" >&2
exit 1
fi
ref="v${version}"
echo "ref=$ref" >> "$GITHUB_OUTPUT"
echo "ailang.toml floor: $ref"
# Sanity-check: install-prerequisites.sh must reference the same version
# so local devs install exactly what CI tests against.
script_ref=$(grep -E '^AILANG_REF=' scripts/install-prerequisites.sh | head -n1 | cut -d'"' -f2)
if [[ "$script_ref" != "$ref" ]]; then
echo "::error::Version mismatch: ailang.toml floor=$ref but install-prerequisites.sh AILANG_REF=$script_ref — bump them together." >&2
exit 1
fi
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: '1.22.5'
cache: false
- name: Build AILANG at pinned ref
env:
AILANG_REF: ${{ steps.pin.outputs.ref }}
run: |
set -euo pipefail
src="$HOME/.local/share/ailang"
git clone --depth 1 --branch "$AILANG_REF" \
https://github.com/sunholo-data/ailang "$src"
commit="$(git -C "$src" rev-parse HEAD)"
build_time="$(date -u '+%Y-%m-%d_%H:%M:%S')"
ldflags="-X github.com/sunholo-data/ailang/internal/version.Version=${AILANG_REF}"
ldflags="${ldflags} -X github.com/sunholo-data/ailang/internal/version.Commit=${commit}"
ldflags="${ldflags} -X github.com/sunholo-data/ailang/internal/version.BuildTime=${build_time}"
(cd "$src" && go build -ldflags "$ldflags" -o "$HOME/.local/bin/ailang" ./cmd/ailang)
mkdir -p "$HOME/.local/bin"
chmod +x "$HOME/.local/bin/ailang"
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
- name: Confirm ailang version
run: ailang --version
- name: Sync extension packages
run: ./scripts/sync-extension-packages.sh
- name: ailang lock
run: ailang lock
- name: check_core (verify_extensions + type-check src/core/*.ail)
run: make check_core
- name: smoke_no_delegated_storm (ohmy_pi=false across shipped profiles)
run: make smoke_no_delegated_storm