|
| 1 | +name: E2E (Post-Release) |
| 2 | + |
| 3 | +on: |
| 4 | + release: |
| 5 | + types: [published] |
| 6 | + workflow_dispatch: |
| 7 | + inputs: |
| 8 | + tag: |
| 9 | + description: "Release tag to test (e.g. v0.16.0)" |
| 10 | + required: true |
| 11 | + |
| 12 | +permissions: |
| 13 | + contents: read |
| 14 | + |
| 15 | +jobs: |
| 16 | + smoke: |
| 17 | + name: "E2E · post-release-smoke" |
| 18 | + if: github.event.release.prerelease != true || github.event_name == 'workflow_dispatch' |
| 19 | + runs-on: ubuntu-latest |
| 20 | + timeout-minutes: 15 |
| 21 | + env: |
| 22 | + GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
| 23 | + steps: |
| 24 | + - uses: actions/checkout@v4 |
| 25 | + |
| 26 | + - uses: pnpm/action-setup@v4 |
| 27 | + |
| 28 | + - uses: actions/setup-node@v4 |
| 29 | + with: |
| 30 | + node-version: "22" |
| 31 | + |
| 32 | + - run: pnpm install |
| 33 | + |
| 34 | + - name: Resolve release tag |
| 35 | + id: tag |
| 36 | + shell: bash |
| 37 | + run: | |
| 38 | + if [ "${{ github.event_name }}" = "workflow_dispatch" ]; then |
| 39 | + TAG="${{ inputs.tag }}" |
| 40 | + else |
| 41 | + TAG="${{ github.event.release.tag_name }}" |
| 42 | + fi |
| 43 | + echo "tag=$TAG" >> "$GITHUB_OUTPUT" |
| 44 | +
|
| 45 | + - name: Wait for SEA asset on the release |
| 46 | + shell: /usr/bin/bash -euo pipefail {0} |
| 47 | + run: | |
| 48 | + TAG="${{ steps.tag.outputs.tag }}" |
| 49 | + for i in $(seq 1 30); do |
| 50 | + if gh release view "$TAG" --json assets --jq '.assets[].name' | grep -q "^dot-linux-x64$"; then |
| 51 | + echo "Found dot-linux-x64 asset on attempt $i" |
| 52 | + exit 0 |
| 53 | + fi |
| 54 | + echo " attempt $i/30: waiting for asset..." |
| 55 | + sleep 10 |
| 56 | + done |
| 57 | + echo "::error::Timed out waiting for dot-linux-x64 asset on $TAG" |
| 58 | + exit 1 |
| 59 | +
|
| 60 | + - name: Install via install.sh (consumer path) |
| 61 | + shell: bash |
| 62 | + run: | |
| 63 | + TAG="${{ steps.tag.outputs.tag }}" |
| 64 | + # Pin to the just-released version; install.sh resolves "latest" |
| 65 | + # by default which can lag behind a just-published release. |
| 66 | + # install.sh runs `dot init` at the end; init requires an |
| 67 | + # interactive QR scan and will exit non-zero in headless CI — |
| 68 | + # that is expected. The binary is installed before init runs, |
| 69 | + # so we tolerate the init failure and verify the binary below. |
| 70 | + curl -fsSL "https://raw.githubusercontent.com/${{ github.repository }}/${{ github.sha }}/install.sh" \ |
| 71 | + | VERSION="$TAG" bash || true |
| 72 | + # Hard-fail here if the binary was not installed — that IS a |
| 73 | + # real regression in the install script's download/chmod path. |
| 74 | + ls -la "$HOME/.polkadot/bin/dot" |
| 75 | +
|
| 76 | + - name: Compute installed-binary path |
| 77 | + shell: bash |
| 78 | + run: echo "DOT_E2E_BINARY=$HOME/.polkadot/bin/dot" >> "$GITHUB_ENV" |
| 79 | + |
| 80 | + - name: Smoke test the installed binary |
| 81 | + uses: nick-fields/retry@v3 |
| 82 | + with: |
| 83 | + timeout_minutes: 5 |
| 84 | + max_attempts: 2 |
| 85 | + retry_wait_seconds: 15 |
| 86 | + command: pnpm exec vitest run --config e2e/vitest.config.ts e2e/cli/published.test.ts |
| 87 | + env: |
| 88 | + DOT_TAG: e2e-ci-post-release |
| 89 | + DOT_TELEMETRY: "1" |
| 90 | + |
| 91 | + - name: Upload forensic artefacts |
| 92 | + if: always() |
| 93 | + continue-on-error: true |
| 94 | + uses: actions/upload-artifact@v4 |
| 95 | + with: |
| 96 | + name: e2e-reports-post-release-smoke |
| 97 | + path: e2e-reports/ |
| 98 | + retention-days: 7 |
| 99 | + if-no-files-found: ignore |
0 commit comments