Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,8 @@ jobs:
run: scripts/sync-i18n.sh --check
- name: Verify release version alignment
run: bash scripts/check-release-version.sh
- name: Verify dependency pins stay aligned
run: bash scripts/check-dependency-pins.sh

core:
name: Racket core (contract tests)
Expand Down
48 changes: 48 additions & 0 deletions scripts/check-dependency-pins.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
#!/usr/bin/env bash
set -euo pipefail

ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
WORKFLOWS=(
"$ROOT/.github/workflows/ci.yml"
"$ROOT/.github/workflows/acceptance.yml"
"$ROOT/.github/workflows/release.yml"
)

fail() {
echo "dependency pin preflight: $*" >&2
exit 1
}

env_pin() {
local file="$1"
local name="$2"
sed -nE "s/^[[:space:]]*${name}:[[:space:]]*([0-9a-f]{40})[[:space:]]*$/\\1/p" "$file" | head -n1
}

RIVET_PIN="$(env_pin "${WORKFLOWS[0]}" RIVET_PIN)"
[[ -n "$RIVET_PIN" ]] || fail "missing RIVET_PIN in ci.yml"

for workflow in "${WORKFLOWS[@]}"; do
pin="$(env_pin "$workflow" RIVET_PIN)"
[[ -n "$pin" ]] || fail "missing RIVET_PIN in ${workflow#"$ROOT/"}"
[[ "$pin" == "$RIVET_PIN" ]] || fail "RIVET_PIN drift: ${workflow#"$ROOT/"} has $pin, expected $RIVET_PIN"
done

while IFS= read -r action_pin; do
[[ "$action_pin" == "$RIVET_PIN" ]] || fail "setup-embed-racket ref $action_pin does not match RIVET_PIN $RIVET_PIN"
done < <(
grep -h -oE 'turinglambdaai/rivet/\.github/actions/setup-embed-racket@[0-9a-f]{40}' "${WORKFLOWS[@]}" |
sed -E 's/.*@//'
)

KEEL_PIN="$(env_pin "$ROOT/.github/workflows/acceptance.yml" KEEL_PIN)"
[[ -n "$KEEL_PIN" ]] || fail "missing KEEL_PIN in acceptance.yml"

while IFS= read -r keel_pin; do
[[ "$keel_pin" == "$KEEL_PIN" ]] || fail "Keel pin drift: found $keel_pin, expected $KEEL_PIN"
done < <(
grep -h -oE 'turinglambdaai/keel\.git#[0-9a-f]{40}' "${WORKFLOWS[@]}" |
sed -E 's/.*#//'
)

echo "dependency pin preflight: aligned (Rivet $RIVET_PIN, Keel $KEEL_PIN)"
Loading