diff --git a/.github/scripts/audit_axioms.sh b/.github/scripts/audit_axioms.sh index 9a5b08a..aaafe36 100755 --- a/.github/scripts/audit_axioms.sh +++ b/.github/scripts/audit_axioms.sh @@ -1,6 +1,16 @@ #!/usr/bin/env bash set -euo pipefail root="$(cd "$(dirname "${BASH_SOURCE[0]}")/../.." && pwd)" +if (( $# > 1 )); then + echo "usage: $0 [lake-workspace]" >&2 + exit 2 +fi +workspace="${1:-$root}" +if [[ ! -d "$workspace" ]]; then + echo "Lake workspace does not exist: $workspace" >&2 + exit 2 +fi +workspace="$(cd "$workspace" && pwd)" cd "$root" if command -v lake >/dev/null 2>&1; then lake_cmd="$(command -v lake)" @@ -10,7 +20,9 @@ else echo "lake is not available" >&2 exit 127 fi -if ! output="$($lake_cmd env lean .github/scripts/audit_axioms.lean 2>&1)"; then +if ! output="$( + "$lake_cmd" -d="$workspace" env lean "$root/.github/scripts/audit_axioms.lean" 2>&1 +)"; then printf '%s\n' "$output" >&2 exit 1 fi diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index c4e1180..7e13037 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -73,6 +73,15 @@ jobs: use-mathlib-cache: true use-github-cache: false + - name: Restore CryptBoolean build cache + id: cryptboolean-cache + uses: actions/cache/restore@v6 + with: + path: .lake/build + key: cryptboolean-${{ runner.os }}-${{ runner.arch }}-${{ hashFiles('lean-toolchain', 'lake-manifest.json', 'lakefile.lean', 'CryptBoolean.lean', 'CryptBoolean/**/*.lean') }} + restore-keys: | + cryptboolean-${{ runner.os }}-${{ runner.arch }}- + - name: Build release library as a dependency env: GH_TOKEN: ${{ github.token }} @@ -97,7 +106,15 @@ jobs: - name: Audit release proofs run: | ./.github/scripts/forbidden_tokens.sh - ./.github/scripts/audit_axioms.sh + ./.github/scripts/audit_axioms.sh \ + "$RUNNER_TEMP/cryptboolean-release-builder" + + - name: Save CryptBoolean build cache + if: steps.cryptboolean-cache.outputs.cache-hit != 'true' + uses: actions/cache/save@v6 + with: + path: .lake/build + key: ${{ steps.cryptboolean-cache.outputs.cache-primary-key }} - name: Pack Lake release archive run: |