Skip to content

feat(durable): let a host append Thread-scoped updates to the canonical stream #164

feat(durable): let a host append Thread-scoped updates to the canonical stream

feat(durable): let a host append Thread-scoped updates to the canonical stream #164

Workflow file for this run

name: CI
# One full gate per tree. A pull request runs it on its head; a merge-queue draft runs it on the merged tree. A push
# to main runs it once for the commit that landed. A newer push to a pull request cancels its older run. Commit
# linting of the squashed message lives in `squash-message.yml`, so a title or body edit never re-runs this gate.
on:
push:
branches: [main]
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
permissions:
contents: read
env:
CI: "true"
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: ${{ github.event_name == 'pull_request' && !startsWith(github.head_ref, 'mergify/merge-queue/') }}
jobs:
lint:
name: lint
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# Only a push to main writes the pnpm store; every other run restores it read-only.
- uses: ./.github/actions/workspace
with:
node-version: 24
save-store: "true"
- run: pnpm format:check
- run: pnpm lint
build-and-pack:
name: build and pack
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: ./.github/actions/workspace
with:
node-version: 24
- run: pnpm typecheck
# attw and the export checks guard the built output, so the build precedes them.
- run: pnpm build
- run: pnpm check:exports
- run: pnpm check:record-format
- run: pnpm check:package-purity
- run: pnpm check:pack
changeset:
name: change intent
if: github.event_name == 'pull_request' && github.head_ref != 'changeset-release/main'
uses: systemfsoftware/pnpm-release-management/.github/workflows/changeset-check.yml@a7c8ca88d2ace4fb62bfeff20f594d11cffe3780
permissions:
contents: read
pull-requests: read
# Each heavy suite splits across two runners by test file; the rest of the workspace shares one.
test:
name: test ${{ matrix.lane.name }}
runs-on: ubuntu-latest
timeout-minutes: 30
strategy:
fail-fast: false
matrix:
lane:
- { name: postgres 1/2, shard: 1/2, filter: "--filter @systemfsoftware/agent-storage-postgres" }
- { name: postgres 2/2, shard: 2/2, filter: "--filter @systemfsoftware/agent-storage-postgres" }
- { name: cloudflare 1/2, shard: 1/2, filter: "--filter @systemfsoftware/agent-platform-cloudflare" }
- { name: cloudflare 2/2, shard: 2/2, filter: "--filter @systemfsoftware/agent-platform-cloudflare" }
- { name: agent-testing 1/2, shard: 1/2, filter: "--filter @systemfsoftware/agent-testing" }
- { name: agent-testing 2/2, shard: 2/2, filter: "--filter @systemfsoftware/agent-testing" }
- name: rest
shard: ""
filter: "--workspace-concurrency=4 --filter !@systemfsoftware/agent-storage-postgres --filter !@systemfsoftware/agent-platform-cloudflare --filter !@systemfsoftware/agent-testing"
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
# The integration suites boot Postgres and IntegreSQL in microVMs, which need the runner's KVM device.
- name: Grant KVM
run: |
echo 'KERNEL=="kvm", GROUP="kvm", MODE="0666", OPTIONS+="static_node=kvm"' | sudo tee /etc/udev/rules.d/99-kvm4all.rules
sudo udevadm control --reload-rules
sudo udevadm trigger --name-match=kvm
# The fixtures pull the digest-pinned IntegreSQL layer from ghcr.io once and keep it here.
- uses: actions/cache@55cc8345863c7cc4c66a329aec7e433d2d1c52a9 # v6.1.0
with:
path: ~/.cache/agent/integresql-layers
key: integresql-${{ runner.arch }}-${{ hashFiles('packages/storage-postgres/test/integresql-binary.ts') }}
- uses: ./.github/actions/workspace
with:
node-version: 26
- name: Run the suites
env:
FILTER: ${{ matrix.lane.filter }}
SHARD: ${{ matrix.lane.shard }}
run: |
read -ra filter <<< "$FILTER"
shard=()
if [ -n "$SHARD" ]; then shard=("--shard=$SHARD"); fi
pnpm -r "${filter[@]}" run test "${shard[@]}"
gritlint:
name: gritlint
runs-on: ubuntu-latest
timeout-minutes: 15
steps:
- uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- uses: cachix/install-nix-action@bb0495a1086c46893eee56f32fd192dfe4a15bb9 # v32.0.0
with:
extra_nix_config: |
extra-substituters = https://nix.systemfsoftware.com
extra-trusted-public-keys = nix-cache-1:wXA8I4DayNW9q6enUyQA/P/nT38pGSTLt374t3gsn7M=
# ubuntu-24.04 ships AppArmor refusing unprivileged user namespaces, which bubblewrap needs.
- name: Let bubblewrap create user namespaces
run: |
if [ -e /proc/sys/kernel/apparmor_restrict_unprivileged_userns ]; then
sudo sysctl -w kernel.apparmor_restrict_unprivileged_userns=0
fi
- name: The house conventions pass over the tree
run: "$(nix build --no-link --print-out-paths .#gritlint)/bin/gritlint check . --format github"
# The one check the ruleset requires and the merge queue gates on; the name matches the shared CI of the other
# systemfsoftware repositories. List every other job in `needs`: a job left out is not gated. The job always runs,
# and any dependency that did not conclude `success` fails it, so a run that did not execute the gate can never
# stand in for one that passed. The change-intent job is skipped on a push and on the release pull request.
check:
name: checks / check
runs-on: ubuntu-latest
timeout-minutes: 5
needs: [lint, build-and-pack, changeset, test, gritlint]
if: ${{ always() }}
steps:
- name: Require every job to succeed
env:
LINT: ${{ needs.lint.result }}
BUILD_AND_PACK: ${{ needs.build-and-pack.result }}
TEST: ${{ needs.test.result }}
GRITLINT: ${{ needs.gritlint.result }}
CHANGESET: ${{ needs.changeset.result }}
EVENT: ${{ github.event_name }}
HEAD_REF: ${{ github.head_ref }}
run: |
status=0
for pair in "lint:$LINT" "build-and-pack:$BUILD_AND_PACK" "test:$TEST" "gritlint:$GRITLINT"; do
case "$pair" in
*:success) ;;
*) echo "A required job finished as: $pair"; status=1 ;;
esac
done
if [ "$CHANGESET" != success ]; then
if [ "$CHANGESET" = skipped ] && { [ "$EVENT" != pull_request ] || [ "$HEAD_REF" = changeset-release/main ]; }; then
:
else
echo "A required job finished as: changeset:$CHANGESET"
status=1
fi
fi
exit "$status"