build: bump amaru to feat/testnet-bootstrap HEAD + adapt create-snapshots CLI #120
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: CI | |
| on: | |
| push: | |
| branches: [main] | |
| pull_request: | |
| branches: [main] | |
| permissions: | |
| contents: read | |
| packages: read | |
| concurrency: | |
| group: ${{ github.workflow }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| # Build Gate — populates the shared nix store. Self-hosted nixos | |
| # runners share /nix; without a single warming job, every downstream | |
| # job evaluates the same derivations and fights the eval-cache lock. | |
| build-gate: | |
| name: Build Gate | |
| runs-on: nixos | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: paolino | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Build all flake checks (except the smoke-test verdict) | |
| run: >- | |
| nix build --quiet | |
| .#checks.x86_64-linux.amaru | |
| .#checks.x86_64-linux.db-synthesizer | |
| .#checks.x86_64-linux.db-analyser | |
| .#checks.x86_64-linux.ledger-state-emitter | |
| .#checks.x86_64-linux.shellcheck | |
| .#checks.x86_64-linux.smoke-test-bats | |
| .#checks.x86_64-linux.header-extractor-spec | |
| .#checks.x86_64-linux.header-extractor-cli-bats | |
| .#checks.x86_64-linux.bootstrap-producer-bats | |
| .#checks.x86_64-linux.bootstrap-producer-synthesized | |
| .#checks.x86_64-linux.amaru-run-bootstrap | |
| .#checks.x86_64-linux.antithesis-short-epoch-samples | |
| .#checks.x86_64-linux.antithesis-short-epoch-golden | |
| .#checks.x86_64-linux.bootstrap-producer-image | |
| - name: Materialize bootstrap-producer image artifact | |
| run: | | |
| nix build --quiet \ | |
| .#packages.x86_64-linux.bootstrap-producer-image \ | |
| -o result-bootstrap-producer-image | |
| cp -L result-bootstrap-producer-image \ | |
| "$RUNNER_TEMP/amaru-bootstrap-producer-${GITHUB_SHA}.tar.gz" | |
| - name: Upload bootstrap-producer image artifact | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: bootstrap-producer-image-${{ github.sha }} | |
| path: ${{ runner.temp }}/amaru-bootstrap-producer-${{ github.sha }}.tar.gz | |
| if-no-files-found: error | |
| compression-level: 0 | |
| retention-days: 30 | |
| # The Phase 0 verdict job. Runs the orchestrator end-to-end against | |
| # the vendored fixture; its pass/fail answers the no-fork hypothesis. | |
| smoke-test: | |
| name: Smoke Test (Phase 0 verdict) | |
| needs: build-gate | |
| runs-on: nixos | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: paolino | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Run smoke test | |
| run: | | |
| out_dir="$RUNNER_TEMP/smoke-out" | |
| rm -rf "$out_dir" | |
| # The orchestrator exits non-zero on FAIL: format mismatch | |
| # (per contracts/smoke-test-cli.md exit-codes), so we MUST | |
| # capture-and-ignore its exit code. Whether the *job* | |
| # passes or fails is decided below from the verdict string, | |
| # not from the orchestrator's exit code. | |
| set +e | |
| nix run --quiet .#smoke-test -- \ | |
| specs/001-snapshot-format-smoke/fixtures/p1-config \ | |
| "$out_dir" \ | |
| 2>&1 | tee "$RUNNER_TEMP/verdict.log" | |
| set -e | |
| verdict="$(tail -n 1 "$RUNNER_TEMP/verdict.log")" | |
| report="$(tail -n 2 "$RUNNER_TEMP/verdict.log" | head -n 1)" | |
| { | |
| echo "## Phase 0 Verdict" | |
| echo | |
| echo "**\`$verdict\`**" | |
| echo | |
| echo "Report: \`${report#report: }\`" | |
| } >>"$GITHUB_STEP_SUMMARY" | |
| # Per spec/plan: PASS and "FAIL: format mismatch" are both | |
| # valid hypothesis outcomes (the test ran end-to-end and | |
| # produced an answer). Tool / configuration errors mean the | |
| # test never reached the hypothesis and must be fixed. | |
| case "$verdict" in | |
| PASS) | |
| echo "::notice::Phase 0 PASS — no-fork hypothesis validated" ;; | |
| "FAIL: format mismatch") | |
| echo "::notice::Phase 0 FAIL: format mismatch — hypothesis falsified, pivot to standalone snapshot-emitter (still no fork)" ;; | |
| *) | |
| echo "::error::Phase 0 verdict not reached: $verdict" | |
| exit 1 ;; | |
| esac | |
| - name: Upload verdict artefacts | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: smoke-out | |
| path: ${{ runner.temp }}/smoke-out | |
| if-no-files-found: warn | |
| retention-days: 30 | |
| live-bootstrap-producer: | |
| name: Live Bootstrap Producer | |
| needs: build-gate | |
| runs-on: nixos | |
| timeout-minutes: 20 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - uses: cachix/cachix-action@v15 | |
| with: | |
| name: paolino | |
| authToken: ${{ secrets.CACHIX_AUTH_TOKEN }} | |
| - name: Check Docker daemon | |
| run: nix --quiet shell nixpkgs#docker-client -c docker info | |
| - name: Build and load bootstrap-producer image | |
| run: | | |
| nix build --quiet \ | |
| .#packages.x86_64-linux.bootstrap-producer-image \ | |
| -o result-bootstrap-producer-image | |
| nix --quiet shell nixpkgs#docker-client \ | |
| -c docker load -i result-bootstrap-producer-image | |
| - name: Log in to GHCR for external image pulls | |
| env: | |
| GHCR_TOKEN: ${{ github.token }} | |
| run: | | |
| printf '%s' "$GHCR_TOKEN" \ | |
| | nix --quiet shell nixpkgs#docker-client \ | |
| -c docker login ghcr.io \ | |
| -u "$GITHUB_ACTOR" \ | |
| --password-stdin | |
| - name: Pull cardano-node 10.7.1 image | |
| env: | |
| CARDANO_NODE_IMAGE: ghcr.io/intersectmbo/cardano-node:10.7.1-amd64 | |
| run: | | |
| for attempt in 1 2 3 4 5; do | |
| if nix --quiet shell nixpkgs#docker-client \ | |
| -c docker pull "$CARDANO_NODE_IMAGE" | |
| then | |
| exit 0 | |
| fi | |
| delay=$((attempt * 15)) | |
| echo "cardano-node image pull failed on attempt ${attempt}; retrying in ${delay}s" >&2 | |
| sleep "$delay" | |
| done | |
| nix --quiet shell nixpkgs#docker-client \ | |
| -c docker pull "$CARDANO_NODE_IMAGE" | |
| - name: Run live ChainDB verifier | |
| env: | |
| BOOTSTRAP_PRODUCER_IMAGE: amaru-bootstrap-producer:dev | |
| CARDANO_NODE_IMAGE: ghcr.io/intersectmbo/cardano-node:10.7.1-amd64 | |
| run: >- | |
| nix --quiet shell | |
| .#checks.x86_64-linux.db-synthesizer | |
| nixpkgs#bash | |
| nixpkgs#bats | |
| nixpkgs#coreutils | |
| nixpkgs#findutils | |
| nixpkgs#gnugrep | |
| nixpkgs#jq | |
| nixpkgs#docker-client | |
| -c bats --tap tests/test-bootstrap-producer-live.bats |