From 5ad398320447065f4bbbeb6466d44869d6db0db6 Mon Sep 17 00:00:00 2001 From: Wiktor Starczewski Date: Tue, 5 May 2026 18:00:49 +0200 Subject: [PATCH 1/2] ci: split chrome e2e per-network for nightly + node-monitor symmetry MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replaces the multi-network e2e-blockchain.yml with three workflows that match how the wallet is actually monitored downstream — the network- monitor exists in devnet and testnet flavors, and each only cares about its own network's nightly result. - e2e-blockchain-chrome-devnet.yml: chrome devnet only, push + nightly (04:00 UTC) + workflow_dispatch. Auto-creates a tracking issue on scheduled-run failures (push reds stay on the merge commit). - e2e-blockchain-chrome-testnet.yml: chrome testnet only, same shape. - e2e-blockchain-mobile.yml: iOS lanes (renamed from e2e-blockchain.yml, mobile sections only). Push trigger only — macOS minutes are 10x and the on-push cadence is enough. Trade-off: the previous 'AT LEAST ONE network passed' merge tolerance inside a single chrome workflow no longer exists, since each network is its own workflow now. If you want that tolerance preserved at the merge gate, configure branch protection so neither devnet nor testnet is a hard required check; the network-monitor cards carry the day-to-day visibility. Companion: 0xMiden/node nightly-card PR. --- .../e2e-blockchain-chrome-devnet.yml | 131 ++++++++++++++ .../e2e-blockchain-chrome-testnet.yml | 123 +++++++++++++ ...ockchain.yml => e2e-blockchain-mobile.yml} | 163 ++---------------- 3 files changed, 265 insertions(+), 152 deletions(-) create mode 100644 .github/workflows/e2e-blockchain-chrome-devnet.yml create mode 100644 .github/workflows/e2e-blockchain-chrome-testnet.yml rename .github/workflows/{e2e-blockchain.yml => e2e-blockchain-mobile.yml} (59%) diff --git a/.github/workflows/e2e-blockchain-chrome-devnet.yml b/.github/workflows/e2e-blockchain-chrome-devnet.yml new file mode 100644 index 00000000..396aa077 --- /dev/null +++ b/.github/workflows/e2e-blockchain-chrome-devnet.yml @@ -0,0 +1,131 @@ +name: E2E Blockchain (Chrome, devnet) + +# Chrome extension blockchain-backed E2E suite against devnet. +# Runs on every push to main AND nightly at 04:00 UTC. +# +# Split out from the multi-network workflow so the devnet network-monitor +# card can pin to a single workflow id (its symmetric testnet counterpart +# lives in `e2e-blockchain-chrome-testnet.yml`). Each network is now +# independently merge-required / monitorable. +# +# NOTE: with this split the previous "AT LEAST ONE network passed" +# merge-tolerance is no longer enforced inside a workflow. If you want +# that tolerance preserved at the merge gate, configure branch protection +# to NOT require both workflows; the on-dashboard signal handles the +# day-to-day visibility. + +on: + push: + branches: + - main + schedule: + - cron: '0 4 * * *' + workflow_dispatch: {} + +permissions: + contents: read + issues: write # for the schedule-only failure-issue step below + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + chrome-devnet: + name: Chrome E2E (devnet) + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + E2E_NETWORK: devnet + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + # cargo is needed to install miden-client-cli from crates.io on first run. + - uses: dtolnay/rust-toolchain@stable + + - name: Cache miden-client-cli + # Cache key follows the root package.json so a SDK version bump + # (or any other root-level dep change) naturally invalidates — the + # CLI is installed version-matched to @miden-sdk/miden-sdk by + # helpers/miden-cli.ts. + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/miden-client + key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} + + - name: Install dependencies + run: yarn install --frozen-lockfile + + # Pre-install the miden-client-cli so the cold-cache ~7 min cargo + # compile happens in its own step, not inside Playwright's 5-min + # per-test timeout. `cargo install` is a no-op on warm cache. + - name: Install miden-client-cli + shell: bash + run: | + VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") + if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then + echo "miden-client already present from cache:" + "$HOME/.cargo/bin/miden-client" --version || true + else + echo "Installing miden-client-cli@${VERSION}..." + cargo install miden-client-cli --version "$VERSION" + fi + + - name: Install xvfb + run: sudo apt-get update && sudo apt-get install -y xvfb + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run blockchain E2E (devnet) + run: xvfb-run -a yarn test:e2e:blockchain:devnet + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: chrome-e2e-devnet-${{ github.run_id }} + path: test-results/ + retention-days: 7 + if-no-files-found: ignore + + # Auto-create a tracking issue when the SCHEDULED nightly fails. Push + # failures stay visible on the merge commit + Actions tab and don't need + # an issue (PR context already covers them); only the nightly cadence — + # which has no PR context — gets an issue so a red night doesn't rot + # silently. + nightly-failure-issue: + name: Open issue on nightly failure + needs: chrome-devnet + if: failure() && github.event_name == 'schedule' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Create issue + uses: actions/github-script@v7 + with: + script: | + const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const today = new Date().toISOString().slice(0, 10); + const title = `Nightly Chrome E2E (devnet) failed — ${today}`; + const body = [ + `Nightly run [\`${context.runId}\`](${runUrl}) failed on devnet.`, + ``, + `Workflow: \`${context.workflow}\``, + `Commit: \`${context.sha}\``, + ``, + `Auto-created by \`e2e-blockchain-chrome-devnet.yml\` on schedule failure.`, + ].join('\n'); + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title, + body, + labels: ['ci-failure', 'nightly-e2e', 'devnet'], + }); diff --git a/.github/workflows/e2e-blockchain-chrome-testnet.yml b/.github/workflows/e2e-blockchain-chrome-testnet.yml new file mode 100644 index 00000000..bc8d9250 --- /dev/null +++ b/.github/workflows/e2e-blockchain-chrome-testnet.yml @@ -0,0 +1,123 @@ +name: E2E Blockchain (Chrome, testnet) + +# Chrome extension blockchain-backed E2E suite against testnet. +# Runs on every push to main AND nightly at 04:00 UTC. +# +# Split out from the multi-network workflow so the testnet network-monitor +# card can pin to a single workflow id (its symmetric devnet counterpart +# lives in `e2e-blockchain-chrome-devnet.yml`). Each network is now +# independently merge-required / monitorable. +# +# NOTE: with this split the previous "AT LEAST ONE network passed" +# merge-tolerance is no longer enforced inside a workflow. If you want +# that tolerance preserved at the merge gate, configure branch protection +# to NOT require both workflows; the on-dashboard signal handles the +# day-to-day visibility. + +on: + push: + branches: + - main + schedule: + - cron: '0 4 * * *' + workflow_dispatch: {} + +permissions: + contents: read + issues: write # for the schedule-only failure-issue step below + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + chrome-testnet: + name: Chrome E2E (testnet) + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + E2E_NETWORK: testnet + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - uses: dtolnay/rust-toolchain@stable + + - name: Cache miden-client-cli + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/miden-client + key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Install miden-client-cli + shell: bash + run: | + VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") + if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then + echo "miden-client already present from cache:" + "$HOME/.cargo/bin/miden-client" --version || true + else + echo "Installing miden-client-cli@${VERSION}..." + cargo install miden-client-cli --version "$VERSION" + fi + + - name: Install xvfb + run: sudo apt-get update && sudo apt-get install -y xvfb + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run blockchain E2E (testnet) + run: xvfb-run -a yarn test:e2e:blockchain:testnet + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: chrome-e2e-testnet-${{ github.run_id }} + path: test-results/ + retention-days: 7 + if-no-files-found: ignore + + # Auto-create a tracking issue when the SCHEDULED nightly fails. Push + # failures stay visible on the merge commit + Actions tab and don't need + # an issue (PR context already covers them); only the nightly cadence — + # which has no PR context — gets an issue so a red night doesn't rot + # silently. + nightly-failure-issue: + name: Open issue on nightly failure + needs: chrome-testnet + if: failure() && github.event_name == 'schedule' + runs-on: ubuntu-latest + permissions: + issues: write + steps: + - name: Create issue + uses: actions/github-script@v7 + with: + script: | + const runUrl = `https://github.com/${context.repo.owner}/${context.repo.repo}/actions/runs/${context.runId}`; + const today = new Date().toISOString().slice(0, 10); + const title = `Nightly Chrome E2E (testnet) failed — ${today}`; + const body = [ + `Nightly run [\`${context.runId}\`](${runUrl}) failed on testnet.`, + ``, + `Workflow: \`${context.workflow}\``, + `Commit: \`${context.sha}\``, + ``, + `Auto-created by \`e2e-blockchain-chrome-testnet.yml\` on schedule failure.`, + ].join('\n'); + await github.rest.issues.create({ + owner: context.repo.owner, + repo: context.repo.repo, + title, + body, + labels: ['ci-failure', 'nightly-e2e', 'testnet'], + }); diff --git a/.github/workflows/e2e-blockchain.yml b/.github/workflows/e2e-blockchain-mobile.yml similarity index 59% rename from .github/workflows/e2e-blockchain.yml rename to .github/workflows/e2e-blockchain-mobile.yml index 8d161e57..8a8a3bbf 100644 --- a/.github/workflows/e2e-blockchain.yml +++ b/.github/workflows/e2e-blockchain-mobile.yml @@ -1,11 +1,14 @@ -name: E2E Blockchain - -# Runs the blockchain-backed E2E suites (Chrome extension + iOS simulator) -# against public networks on every push to main. The per-platform gate jobs -# pass as long as AT LEAST ONE network (devnet OR testnet) succeeded for -# that platform — this tolerates short windows where wallet@main and a -# single network are protocol-mismatched (e.g. devnet ahead of the pinned -# SDK version). +name: E2E Blockchain (Mobile) + +# iOS-simulator blockchain-backed E2E suites against public networks. +# Runs on every push to main. The gate job passes as long as AT LEAST +# ONE network (devnet OR testnet) succeeded — same protocol-mismatch +# tolerance as the Chrome suite. +# +# NOT on schedule: mobile lanes are macOS-runner-bound (~10× the cost +# of the Chrome lanes) and the on-push cadence already gives same-day +# signal. If a nightly mobile cadence is ever wanted, mirror the +# `schedule:` block from `e2e-blockchain-chrome.yml`. on: push: @@ -31,150 +34,6 @@ concurrency: cancel-in-progress: true jobs: - # --- Chrome --------------------------------------------------------------- - - chrome-devnet: - name: Chrome E2E (devnet) - if: github.event_name != 'workflow_dispatch' || inputs.network == 'both' || inputs.network == 'devnet' - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - E2E_NETWORK: devnet - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: yarn - - # cargo is needed to install miden-client-cli from crates.io on first run. - - uses: dtolnay/rust-toolchain@stable - - - name: Cache miden-client-cli - # Cache key follows the root package.json so a SDK version bump - # (or any other root-level dep change) naturally invalidates — the - # CLI is installed version-matched to @miden-sdk/miden-sdk by - # helpers/miden-cli.ts. - uses: actions/cache@v4 - with: - path: ~/.cargo/bin/miden-client - key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} - - - name: Install dependencies - run: yarn install --frozen-lockfile - - # Pre-install the miden-client-cli so the cold-cache ~7 min cargo - # compile happens in its own step, not inside Playwright's 5-min - # per-test timeout. `cargo install` is a no-op on warm cache. - - name: Install miden-client-cli - shell: bash - run: | - VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") - if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then - echo "miden-client already present from cache:" - "$HOME/.cargo/bin/miden-client" --version || true - else - echo "Installing miden-client-cli@${VERSION}..." - cargo install miden-client-cli --version "$VERSION" - fi - - - name: Install xvfb - run: sudo apt-get update && sudo apt-get install -y xvfb - - - name: Install Playwright browsers - run: npx playwright install --with-deps chromium - - - name: Run blockchain E2E (devnet) - run: xvfb-run -a yarn test:e2e:blockchain:devnet - - - name: Upload artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: chrome-e2e-devnet-${{ github.run_id }} - path: test-results/ - retention-days: 7 - if-no-files-found: ignore - - chrome-testnet: - name: Chrome E2E (testnet) - if: github.event_name != 'workflow_dispatch' || inputs.network == 'both' || inputs.network == 'testnet' - runs-on: ubuntu-latest - timeout-minutes: 60 - env: - E2E_NETWORK: testnet - steps: - - uses: actions/checkout@v4 - - - uses: actions/setup-node@v4 - with: - node-version: 22 - cache: yarn - - - uses: dtolnay/rust-toolchain@stable - - - name: Cache miden-client-cli - uses: actions/cache@v4 - with: - path: ~/.cargo/bin/miden-client - key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} - - - name: Install dependencies - run: yarn install --frozen-lockfile - - - name: Install miden-client-cli - shell: bash - run: | - VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") - if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then - echo "miden-client already present from cache:" - "$HOME/.cargo/bin/miden-client" --version || true - else - echo "Installing miden-client-cli@${VERSION}..." - cargo install miden-client-cli --version "$VERSION" - fi - - - name: Install xvfb - run: sudo apt-get update && sudo apt-get install -y xvfb - - - name: Install Playwright browsers - run: npx playwright install --with-deps chromium - - - name: Run blockchain E2E (testnet) - run: xvfb-run -a yarn test:e2e:blockchain:testnet - - - name: Upload artifacts - if: always() - uses: actions/upload-artifact@v4 - with: - name: chrome-e2e-testnet-${{ github.run_id }} - path: test-results/ - retention-days: 7 - if-no-files-found: ignore - - chrome-gate: - name: Chrome E2E Gate - needs: [chrome-devnet, chrome-testnet] - if: always() - runs-on: ubuntu-latest - steps: - - name: Require at least one network to pass - shell: bash - env: - DEVNET_RESULT: ${{ needs.chrome-devnet.result }} - TESTNET_RESULT: ${{ needs.chrome-testnet.result }} - run: | - echo "devnet=$DEVNET_RESULT testnet=$TESTNET_RESULT" - if [[ "$DEVNET_RESULT" == "success" || "$TESTNET_RESULT" == "success" ]]; then - echo "Chrome E2E: at least one network passed." - exit 0 - fi - echo "Chrome E2E: both networks failed or were skipped." - exit 1 - - # --- iOS Simulator -------------------------------------------------------- - mobile-devnet: name: Mobile E2E (devnet) if: github.event_name != 'workflow_dispatch' || inputs.network == 'both' || inputs.network == 'devnet' From 6b867b29c478dcd4f0afdb459a3aa03b404bc575 Mon Sep 17 00:00:00 2001 From: Wiktor Starczewski Date: Tue, 5 May 2026 18:13:41 +0200 Subject: [PATCH 2/2] ci: restore push-time OR-tolerance gate via separate chrome workflow MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Reviewer feedback: per-network split removed the 'AT LEAST ONE network passed' merge tolerance for main pushes — single-network protocol mismatches (devnet ahead of pinned SDK, etc) would suddenly block merges they previously didn't. Restructured to four chrome+mobile workflows by purpose: e2e-blockchain-chrome.yml — push-only, both networks + gate e2e-blockchain-chrome-devnet.yml — schedule-only, devnet e2e-blockchain-chrome-testnet.yml — schedule-only, testnet e2e-blockchain-mobile.yml — push-only, iOS lanes (unchanged) The schedule-only per-network workflows feed the network-monitor cards (devnet monitor pins to chrome-devnet, testnet monitor pins to chrome-testnet). The push workflow keeps the OR-gate for merge protection. No cross-trigger duplication: chrome.yml runs on push, chrome-{devnet,testnet}.yml run on schedule, neither double-fires. Trade-off settled: tolerance preserved for merge gating, per-network visibility preserved for monitoring. --- .../e2e-blockchain-chrome-devnet.yml | 24 +-- .../e2e-blockchain-chrome-testnet.yml | 24 +-- .github/workflows/e2e-blockchain-chrome.yml | 181 ++++++++++++++++++ 3 files changed, 195 insertions(+), 34 deletions(-) create mode 100644 .github/workflows/e2e-blockchain-chrome.yml diff --git a/.github/workflows/e2e-blockchain-chrome-devnet.yml b/.github/workflows/e2e-blockchain-chrome-devnet.yml index 396aa077..0bf5f8d9 100644 --- a/.github/workflows/e2e-blockchain-chrome-devnet.yml +++ b/.github/workflows/e2e-blockchain-chrome-devnet.yml @@ -1,23 +1,13 @@ -name: E2E Blockchain (Chrome, devnet) +name: E2E Blockchain (Chrome, devnet) — Nightly -# Chrome extension blockchain-backed E2E suite against devnet. -# Runs on every push to main AND nightly at 04:00 UTC. -# -# Split out from the multi-network workflow so the devnet network-monitor -# card can pin to a single workflow id (its symmetric testnet counterpart -# lives in `e2e-blockchain-chrome-testnet.yml`). Each network is now -# independently merge-required / monitorable. -# -# NOTE: with this split the previous "AT LEAST ONE network passed" -# merge-tolerance is no longer enforced inside a workflow. If you want -# that tolerance preserved at the merge gate, configure branch protection -# to NOT require both workflows; the on-dashboard signal handles the -# day-to-day visibility. +# Chrome extension blockchain-backed E2E suite against devnet — NIGHTLY only. +# Push-on-main coverage (with the OR-tolerance gate across both networks) +# lives in `e2e-blockchain-chrome.yml`; this workflow exists per-network +# so the devnet network-monitor card can pin to a single workflow id +# without contention from push runs. Symmetric testnet sibling: +# `e2e-blockchain-chrome-testnet.yml`. on: - push: - branches: - - main schedule: - cron: '0 4 * * *' workflow_dispatch: {} diff --git a/.github/workflows/e2e-blockchain-chrome-testnet.yml b/.github/workflows/e2e-blockchain-chrome-testnet.yml index bc8d9250..a5bd0d97 100644 --- a/.github/workflows/e2e-blockchain-chrome-testnet.yml +++ b/.github/workflows/e2e-blockchain-chrome-testnet.yml @@ -1,23 +1,13 @@ -name: E2E Blockchain (Chrome, testnet) +name: E2E Blockchain (Chrome, testnet) — Nightly -# Chrome extension blockchain-backed E2E suite against testnet. -# Runs on every push to main AND nightly at 04:00 UTC. -# -# Split out from the multi-network workflow so the testnet network-monitor -# card can pin to a single workflow id (its symmetric devnet counterpart -# lives in `e2e-blockchain-chrome-devnet.yml`). Each network is now -# independently merge-required / monitorable. -# -# NOTE: with this split the previous "AT LEAST ONE network passed" -# merge-tolerance is no longer enforced inside a workflow. If you want -# that tolerance preserved at the merge gate, configure branch protection -# to NOT require both workflows; the on-dashboard signal handles the -# day-to-day visibility. +# Chrome extension blockchain-backed E2E suite against testnet — NIGHTLY only. +# Push-on-main coverage (with the OR-tolerance gate across both networks) +# lives in `e2e-blockchain-chrome.yml`; this workflow exists per-network +# so the testnet network-monitor card can pin to a single workflow id +# without contention from push runs. Symmetric devnet sibling: +# `e2e-blockchain-chrome-devnet.yml`. on: - push: - branches: - - main schedule: - cron: '0 4 * * *' workflow_dispatch: {} diff --git a/.github/workflows/e2e-blockchain-chrome.yml b/.github/workflows/e2e-blockchain-chrome.yml new file mode 100644 index 00000000..023b9b92 --- /dev/null +++ b/.github/workflows/e2e-blockchain-chrome.yml @@ -0,0 +1,181 @@ +name: E2E Blockchain (Chrome) — Push + +# Chrome extension blockchain-backed E2E suites against public networks. +# Runs on every push to main. The gate job passes as long as AT LEAST +# ONE network (devnet OR testnet) succeeded — this tolerates short +# windows where wallet@main and a single network are protocol-mismatched +# (e.g. devnet ahead of the pinned SDK version). +# +# This workflow only runs on push. Nightly per-network coverage lives in +# the schedule-only siblings: +# - e2e-blockchain-chrome-devnet.yml +# - e2e-blockchain-chrome-testnet.yml +# +# The split exists because the network-monitor's devnet/testnet +# instances each pin to one schedule-only workflow file; running both +# networks in a single push workflow keeps the merge-gate tolerance the +# team has come to rely on. + +on: + push: + branches: + - main + workflow_dispatch: + inputs: + network: + description: 'Network(s) to test against' + required: false + default: 'both' + type: choice + options: + - both + - devnet + - testnet + +permissions: + contents: read + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: true + +jobs: + chrome-devnet: + name: Chrome E2E (devnet) + if: github.event_name != 'workflow_dispatch' || inputs.network == 'both' || inputs.network == 'devnet' + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + E2E_NETWORK: devnet + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + # cargo is needed to install miden-client-cli from crates.io on first run. + - uses: dtolnay/rust-toolchain@stable + + - name: Cache miden-client-cli + # Cache key follows the root package.json so a SDK version bump + # (or any other root-level dep change) naturally invalidates — the + # CLI is installed version-matched to @miden-sdk/miden-sdk by + # helpers/miden-cli.ts. + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/miden-client + key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} + + - name: Install dependencies + run: yarn install --frozen-lockfile + + # Pre-install the miden-client-cli so the cold-cache ~7 min cargo + # compile happens in its own step, not inside Playwright's 5-min + # per-test timeout. `cargo install` is a no-op on warm cache. + - name: Install miden-client-cli + shell: bash + run: | + VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") + if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then + echo "miden-client already present from cache:" + "$HOME/.cargo/bin/miden-client" --version || true + else + echo "Installing miden-client-cli@${VERSION}..." + cargo install miden-client-cli --version "$VERSION" + fi + + - name: Install xvfb + run: sudo apt-get update && sudo apt-get install -y xvfb + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run blockchain E2E (devnet) + run: xvfb-run -a yarn test:e2e:blockchain:devnet + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: chrome-e2e-devnet-${{ github.run_id }} + path: test-results/ + retention-days: 7 + if-no-files-found: ignore + + chrome-testnet: + name: Chrome E2E (testnet) + if: github.event_name != 'workflow_dispatch' || inputs.network == 'both' || inputs.network == 'testnet' + runs-on: ubuntu-latest + timeout-minutes: 60 + env: + E2E_NETWORK: testnet + steps: + - uses: actions/checkout@v4 + + - uses: actions/setup-node@v4 + with: + node-version: 22 + cache: yarn + + - uses: dtolnay/rust-toolchain@stable + + - name: Cache miden-client-cli + uses: actions/cache@v4 + with: + path: ~/.cargo/bin/miden-client + key: miden-client-cli-${{ runner.os }}-${{ hashFiles('package.json') }} + + - name: Install dependencies + run: yarn install --frozen-lockfile + + - name: Install miden-client-cli + shell: bash + run: | + VERSION=$(node -p "require('./node_modules/@miden-sdk/miden-sdk/package.json').version") + if [[ -x "$HOME/.cargo/bin/miden-client" ]]; then + echo "miden-client already present from cache:" + "$HOME/.cargo/bin/miden-client" --version || true + else + echo "Installing miden-client-cli@${VERSION}..." + cargo install miden-client-cli --version "$VERSION" + fi + + - name: Install xvfb + run: sudo apt-get update && sudo apt-get install -y xvfb + + - name: Install Playwright browsers + run: npx playwright install --with-deps chromium + + - name: Run blockchain E2E (testnet) + run: xvfb-run -a yarn test:e2e:blockchain:testnet + + - name: Upload artifacts + if: always() + uses: actions/upload-artifact@v4 + with: + name: chrome-e2e-testnet-${{ github.run_id }} + path: test-results/ + retention-days: 7 + if-no-files-found: ignore + + chrome-gate: + name: Chrome E2E Gate + needs: [chrome-devnet, chrome-testnet] + if: always() + runs-on: ubuntu-latest + steps: + - name: Require at least one network to pass + shell: bash + env: + DEVNET_RESULT: ${{ needs.chrome-devnet.result }} + TESTNET_RESULT: ${{ needs.chrome-testnet.result }} + run: | + echo "devnet=$DEVNET_RESULT testnet=$TESTNET_RESULT" + if [[ "$DEVNET_RESULT" == "success" || "$TESTNET_RESULT" == "success" ]]; then + echo "Chrome E2E: at least one network passed." + exit 0 + fi + echo "Chrome E2E: both networks failed or were skipped." + exit 1