|
| 1 | +# End-to-end devnet smoke gate. |
| 2 | +# |
| 3 | +# Purpose: prove the one build-green role that no other job exercises — the |
| 4 | +# Yaci DevKit *devnet* — actually works end to end, and that the devnet↔off-chain |
| 5 | +# `.env` seam connects. Every other gate leaves this role untested: |
| 6 | +# • scheduled-smoke.yml intentionally EXCLUDES yaci (its `just` targets that a |
| 7 | +# no-op runner sees only echo), so nothing builds/tests the devnet role. |
| 8 | +# • The template degrades gracefully — with no yaci-devkit installed, every |
| 9 | +# layer skips and exits 0. Green, but proving nothing. |
| 10 | +# |
| 11 | +# This job installs yaci-devkit for real, scaffolds a fullstack project |
| 12 | +# (aiken on-chain → blueprint → meshjs off-chain → yaci devnet), and runs the |
| 13 | +# whole thing under CARDANO_INIT_REQUIRE_DEVNET=1, which turns every graceful |
| 14 | +# skip into a hard failure. So a green run here MEANS: the devnet came up, the |
| 15 | +# indexer served the chain, and the off-chain mint→lock→redeem round-trip |
| 16 | +# executed against it — never a vacuous skip. |
| 17 | +# |
| 18 | +# Like scheduled-smoke/installer-recipes, it depends on the live world (an npm |
| 19 | +# release, a cardano-node download), so it runs on a schedule + on demand, never |
| 20 | +# as an every-commit gate, and files a tracking issue on scheduled failure. |
| 21 | + |
| 22 | +name: devnet-smoke |
| 23 | + |
| 24 | +on: |
| 25 | + schedule: |
| 26 | + - cron: "0 8 * * 1" # Mondays 08:00 UTC, after scheduled-smoke (06:00) and installer-recipes (07:00) |
| 27 | + workflow_dispatch: {} # allow manual runs |
| 28 | + # Opt-in per-PR run: add the `run-devnet-smoke` label to a PR to run this |
| 29 | + # (heavy, world-dependent) gate against that PR's code. Re-add to re-run. |
| 30 | + pull_request: |
| 31 | + types: [labeled] |
| 32 | + |
| 33 | +permissions: |
| 34 | + contents: read |
| 35 | + |
| 36 | +jobs: |
| 37 | + devnet: |
| 38 | + name: yaci devnet end-to-end |
| 39 | + # Schedule and manual runs always run; PR runs only for our opt-in label |
| 40 | + # (a `labeled` event fires for every label, so filter to ours). |
| 41 | + if: github.event_name != 'pull_request' || github.event.label.name == 'run-devnet-smoke' |
| 42 | + runs-on: ubuntu-latest |
| 43 | + timeout-minutes: 30 |
| 44 | + steps: |
| 45 | + - uses: actions/checkout@v5 |
| 46 | + |
| 47 | + - name: Install Rust |
| 48 | + uses: dtolnay/rust-toolchain@stable |
| 49 | + |
| 50 | + - name: Install just |
| 51 | + uses: extractions/setup-just@v4 |
| 52 | + |
| 53 | + # Off-chain (meshjs) + the yaci-devkit CLI both run on Node. |
| 54 | + - name: Install Node |
| 55 | + uses: actions/setup-node@v5 |
| 56 | + with: |
| 57 | + node-version: 20 |
| 58 | + |
| 59 | + # yaci-cli / yaci-store are JVM services; the devkit needs a JDK on PATH. |
| 60 | + - name: Install JDK |
| 61 | + uses: actions/setup-java@v4 |
| 62 | + with: |
| 63 | + distribution: temurin |
| 64 | + java-version: 21 |
| 65 | + |
| 66 | + - name: Install Aiken |
| 67 | + uses: aiken-lang/setup-aiken@v1 |
| 68 | + with: |
| 69 | + # Keep this in lockstep with templates/aiken/on-chain/aiken.toml.jinja. |
| 70 | + version: v1.1.21 |
| 71 | + |
| 72 | + - name: Install yaci-devkit |
| 73 | + run: npm install -g @bloxbean/yaci-devkit |
| 74 | + |
| 75 | + # The first `yaci-devkit up` downloads a cardano-node into ~/.yaci-cli; |
| 76 | + # cache it so subsequent runs skip the (large) download. |
| 77 | + - name: Cache yaci-cli node download |
| 78 | + uses: actions/cache@v4 |
| 79 | + with: |
| 80 | + path: ~/.yaci-cli |
| 81 | + key: yaci-cli-${{ runner.os }} |
| 82 | + |
| 83 | + - name: Scaffold a fullstack project in isolation |
| 84 | + run: cargo run --quiet -- --name devnet-smoke --on-chain aiken --off-chain meshjs --devnet yaci |
| 85 | + |
| 86 | + - name: Build & run the end-to-end devnet smoke |
| 87 | + working-directory: devnet-smoke |
| 88 | + # CARDANO_INIT_REQUIRE_DEVNET=1 makes every graceful skip a hard failure, |
| 89 | + # so this cannot pass vacuously. `just build` produces the on-chain |
| 90 | + # blueprint and installs off-chain deps; `just test` builds the blueprint |
| 91 | + # first, then the devnet component spins up an ephemeral devnet and runs |
| 92 | + # its integration test + the off-chain round-trip against it (guaranteed |
| 93 | + # teardown via trap). |
| 94 | + env: |
| 95 | + CARDANO_INIT_REQUIRE_DEVNET: "1" |
| 96 | + run: | |
| 97 | + just build |
| 98 | + just test |
| 99 | +
|
| 100 | + notify-on-failure: |
| 101 | + needs: devnet |
| 102 | + # Only file an issue for the unattended scheduled run, not manual debugging. |
| 103 | + if: failure() && github.event_name == 'schedule' |
| 104 | + runs-on: ubuntu-latest |
| 105 | + permissions: |
| 106 | + issues: write |
| 107 | + steps: |
| 108 | + - uses: actions/github-script@v8 |
| 109 | + with: |
| 110 | + script: | |
| 111 | + const { owner, repo } = context.repo; |
| 112 | + const label = "devnet-smoke"; |
| 113 | + const title = "Devnet smoke failed: the Yaci devnet no longer works end to end"; |
| 114 | + const today = new Date().toISOString().slice(0, 10); |
| 115 | + const runUrl = `${context.serverUrl}/${owner}/${repo}/actions/runs/${context.runId}`; |
| 116 | + const body = [ |
| 117 | + `The weekly devnet end-to-end smoke failed on ${today}.`, |
| 118 | + ``, |
| 119 | + `A scaffolded fullstack project's devnet↔off-chain seam stopped working —`, |
| 120 | + `likely a breaking yaci-devkit release, a cardano-node download/boot`, |
| 121 | + `failure, or upstream drift in the off-chain provider. The run log shows`, |
| 122 | + `which stage failed (devnet boot, indexer liveness, or the round-trip).`, |
| 123 | + ``, |
| 124 | + `Run: ${runUrl}`, |
| 125 | + ].join("\n"); |
| 126 | +
|
| 127 | + // De-dupe: comment on the existing open issue instead of spamming a |
| 128 | + // new one every Monday. (Creating an issue auto-creates the label.) |
| 129 | + const existing = await github.rest.issues.listForRepo({ |
| 130 | + owner, repo, state: "open", labels: label, |
| 131 | + }); |
| 132 | + if (existing.data.length === 0) { |
| 133 | + await github.rest.issues.create({ owner, repo, title, body, labels: [label] }); |
| 134 | + } else { |
| 135 | + await github.rest.issues.createComment({ |
| 136 | + owner, repo, issue_number: existing.data[0].number, body, |
| 137 | + }); |
| 138 | + } |
0 commit comments