From 6b970f06a0f8f9c3b7d5d3f6a7666b68249c0bff Mon Sep 17 00:00:00 2001 From: fredespi Date: Wed, 7 Oct 2026 15:56:50 +0200 Subject: [PATCH 1/7] ci(nightly): publish the E2E support matrix to the repo wiki After each nightly, copy the consolidated platform summary and scenario grid into the E2E-Support-Matrix wiki page, overwritten nightly, with run link, commit and date in its header. Signed-off-by: fredespi-agent-app[bot] <266462846+fredespi-agent-app[bot]@users.noreply.github.com> Signed-off-by: fredespi --- .github/workflows/nightly.yml | 63 +++++++++++++++++++++++++++++++++- xtask/src/workflow_contract.rs | 21 ++++++++++++ 2 files changed, 83 insertions(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 71fb11192b..75701f1821 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1620,7 +1620,8 @@ jobs: mkdir -p consolidated cargo xtask e2e-report \ --artifacts-dir e2e-artifacts \ - --html-out consolidated/index.html >> "$GITHUB_STEP_SUMMARY" + --html-out consolidated/index.html > consolidated/support-matrix.md + cat consolidated/support-matrix.md >> "$GITHUB_STEP_SUMMARY" - name: Upload consolidated report if: always() @@ -1628,3 +1629,63 @@ jobs: with: name: e2e-consolidated-report-nightly path: consolidated/ + + # Publishes the consolidated nightly matrix to the repo wiki so the latest + # support matrix is readable without opening a run's artifacts. The page is + # overwritten each night; the run link, commit and date in its header say + # which run it came from. + publish-e2e-wiki: + name: Publish E2E support matrix to wiki + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + needs: e2e-report-nightly + if: always() && needs.e2e-report-nightly.result == 'success' && github.repository == 'ROCm/rocm-cli' + concurrency: + group: publish-e2e-wiki + cancel-in-progress: false + steps: + - name: Download consolidated nightly report + uses: actions/download-artifact@3e5f45b2cfb9172054b4087a40e8e0b5a5461e7c # v8.0.1 + with: + name: e2e-consolidated-report-nightly + path: consolidated + + - name: Push page to the wiki + env: + GH_TOKEN: ${{ github.token }} + RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }} + COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} + run: | + set -euo pipefail + page=E2E-Support-Matrix.md + { + echo "# E2E support matrix (latest nightly)" + echo + echo "_Overwritten by the nightly workflow; do not edit by hand._" + echo + echo "- Run: [${GITHUB_RUN_NUMBER}](${RUN_URL})" + echo "- Commit: [\`${GITHUB_SHA::12}\`](${COMMIT_URL})" + echo "- Date: $(date -u +'%Y-%m-%d %H:%M UTC')" + echo + cat consolidated/support-matrix.md + } > "/tmp/${page}" + + wiki="https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" + # A wiki with no page yet has no git repo to clone; start one. + if ! git clone --depth 1 "$wiki" wiki; then + git init -b master wiki + git -C wiki remote add origin "$wiki" + fi + cp "/tmp/${page}" "wiki/${page}" + cd wiki + git config user.name "github-actions[bot]" + git config user.email "41898282+github-actions[bot]@users.noreply.github.com" + git add "$page" + if git diff --cached --quiet; then + echo "Wiki page already up to date." + exit 0 + fi + git commit -m "Update E2E support matrix from nightly run ${GITHUB_RUN_NUMBER}" + git push origin HEAD diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index ef9d9e24da..fd93edb47d 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1704,6 +1704,27 @@ esac } } + #[test] + fn nightly_publishes_the_consolidated_matrix_to_the_wiki() { + let nightly = read_workflow("nightly.yml"); + let report = job_block(&nightly, "e2e-report-nightly"); + assert!( + report.contains("consolidated/support-matrix.md"), + "the consolidated report job must keep the markdown matrix as a file for the wiki job" + ); + let publish = job_block(&nightly, "publish-e2e-wiki"); + assert_eq!( + job_scalar(publish, "needs"), + "e2e-report-nightly", + "the wiki job must publish the consolidated report, so it must wait for it" + ); + assert!( + publish.contains("name: e2e-consolidated-report-nightly") + && publish.contains(".wiki.git"), + "the wiki job must download the nightly consolidated artifact and push to the wiki repo" + ); + } + #[test] fn dispatchable_wsl_nightly_run_has_the_full_nightly_job_budget() { let self_hosted = read_workflow("e2e-selfhosted.yml"); From 9aa306605fda64c2e7ebcc0c0d442cb54a424f0a Mon Sep 17 00:00:00 2001 From: fredespi Date: Wed, 7 Oct 2026 15:56:50 +0200 Subject: [PATCH 2/7] ci(nightly): fail with the prerequisite when the wiki is uninitialized Signed-off-by: fredespi-agent-app[bot] <266462846+fredespi-agent-app[bot]@users.noreply.github.com> Signed-off-by: fredespi --- .github/workflows/nightly.yml | 8 +++++--- xtask/src/workflow_contract.rs | 4 ++++ 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 75701f1821..06761dd002 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1673,10 +1673,12 @@ jobs: } > "/tmp/${page}" wiki="https://x-access-token:${GH_TOKEN}@github.com/${GITHUB_REPOSITORY}.wiki.git" - # A wiki with no page yet has no git repo to clone; start one. + # GitHub creates the wiki's git repo only when the first page is + # saved in the web UI, so a never-used wiki cannot be cloned or + # pushed to. Fail with the prerequisite rather than a bare 128. if ! git clone --depth 1 "$wiki" wiki; then - git init -b master wiki - git -C wiki remote add origin "$wiki" + echo "::error::Cannot clone the wiki. Enable the wiki in repo settings and create its first page once in the web UI; GitHub does not create the wiki git repo until then." + exit 1 fi cp "/tmp/${page}" "wiki/${page}" cd wiki diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index fd93edb47d..0bf236c106 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1723,6 +1723,10 @@ esac && publish.contains(".wiki.git"), "the wiki job must download the nightly consolidated artifact and push to the wiki repo" ); + assert!( + !publish.contains("git init"), + "git init cannot create the remote wiki; a missing wiki must fail with the prerequisite" + ); } #[test] From 06245c54beef85b0725151ca02fa74e709e0ed04 Mon Sep 17 00:00:00 2001 From: fredespi Date: Wed, 7 Oct 2026 15:56:51 +0200 Subject: [PATCH 3/7] ci(nightly): note that a wiki clone failure may be transient Signed-off-by: fredespi --- .github/workflows/nightly.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 06761dd002..239f31e003 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1677,7 +1677,7 @@ jobs: # saved in the web UI, so a never-used wiki cannot be cloned or # pushed to. Fail with the prerequisite rather than a bare 128. if ! git clone --depth 1 "$wiki" wiki; then - echo "::error::Cannot clone the wiki. Enable the wiki in repo settings and create its first page once in the web UI; GitHub does not create the wiki git repo until then." + echo "::error::Cannot clone the wiki. If this is the first run, enable the wiki in repo settings and create its first page once in the web UI (GitHub does not create the wiki git repo until then); otherwise it may be a transient network failure, so re-run the job." exit 1 fi cp "/tmp/${page}" "wiki/${page}" From a95a82bf2a605477e723a5cf299530d067601aba Mon Sep 17 00:00:00 2001 From: fredespi Date: Thu, 8 Oct 2026 10:20:49 +0200 Subject: [PATCH 4/7] ci(nightly): guard the wiki publish and pin its contract Publish only from non-cancelled main runs that consolidated at least one platform, document the wiki page and its one-time setup, and assert each branch of the job in the contract test. Signed-off-by: fredespi --- .github/workflows/nightly.yml | 11 ++++++-- docs/ci-hardware-testing.md | 8 ++++++ xtask/src/workflow_contract.rs | 50 ++++++++++++++++++++++++++++++---- 3 files changed, 61 insertions(+), 8 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 239f31e003..9d438e0949 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1633,7 +1633,8 @@ jobs: # Publishes the consolidated nightly matrix to the repo wiki so the latest # support matrix is readable without opening a run's artifacts. The page is # overwritten each night; the run link, commit and date in its header say - # which run it came from. + # which run it came from. Main-branch runs only, so a dispatch from another + # branch cannot overwrite the page, and never from an empty or cancelled run. publish-e2e-wiki: name: Publish E2E support matrix to wiki runs-on: ubuntu-latest @@ -1641,7 +1642,7 @@ jobs: permissions: contents: write needs: e2e-report-nightly - if: always() && needs.e2e-report-nightly.result == 'success' && github.repository == 'ROCm/rocm-cli' + if: ${{ !cancelled() && needs.e2e-report-nightly.result == 'success' && github.repository == 'ROCm/rocm-cli' && github.ref == 'refs/heads/main' }} concurrency: group: publish-e2e-wiki cancel-in-progress: false @@ -1659,6 +1660,12 @@ jobs: COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} run: | set -euo pipefail + # An empty consolidation exits 0 upstream; do not replace the last + # good page with a matrix that has no platforms in it. + if grep -q 'No per-platform report.json files were found' consolidated/support-matrix.md; then + echo "::warning::No platform reports were consolidated; leaving the wiki page unchanged." + exit 0 + fi page=E2E-Support-Matrix.md { echo "# E2E support matrix (latest nightly)" diff --git a/docs/ci-hardware-testing.md b/docs/ci-hardware-testing.md index b59ba8f45b..f94da3e85a 100644 --- a/docs/ci-hardware-testing.md +++ b/docs/ci-hardware-testing.md @@ -153,6 +153,14 @@ included. Each joins its platforms' reports — including partial or failed runs — by scenario id into one HTML report and GitHub step summary. +On `main`, the `publish-e2e-wiki` job in `nightly.yml` also copies the +consolidated nightly matrix to the `E2E-Support-Matrix` page of the repository +wiki, overwriting it each night (the page header names the run, commit and +date). It skips cancelled runs and runs that consolidated no platforms. One-time +setup: enable the wiki and save its first page in the GitHub web UI, because +GitHub does not create the wiki's git repository until then and the job fails +with that explanation until it exists. + The lane artifacts are named canonically (`e2e-report`, `e2e-gpu-report`, `e2e-gpu-rad3-report`, `e2e-gpu-mi350p-report`, `e2e-gpu-strix-ubuntu-report`, `e2e-gpu-strix-windows-report`, `e2e-gpu-strix-wsl-report`) in `ci.yml` and diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index 0bf236c106..5319d9e871 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1707,10 +1707,11 @@ esac #[test] fn nightly_publishes_the_consolidated_matrix_to_the_wiki() { let nightly = read_workflow("nightly.yml"); - let report = job_block(&nightly, "e2e-report-nightly"); + let report = normalized_whitespace(job_block(&nightly, "e2e-report-nightly")); assert!( - report.contains("consolidated/support-matrix.md"), - "the consolidated report job must keep the markdown matrix as a file for the wiki job" + report.contains("--html-out consolidated/index.html > consolidated/support-matrix.md"), + "the consolidated report job must redirect the markdown matrix into \ + consolidated/support-matrix.md for the wiki job" ); let publish = job_block(&nightly, "publish-e2e-wiki"); assert_eq!( @@ -1718,14 +1719,51 @@ esac "e2e-report-nightly", "the wiki job must publish the consolidated report, so it must wait for it" ); + let condition = job_scalar(publish, "if"); + for required in [ + "!cancelled()", + "needs.e2e-report-nightly.result == 'success'", + "github.repository == 'ROCm/rocm-cli'", + "github.ref == 'refs/heads/main'", + ] { + assert!( + condition.contains(required), + "the wiki job's `if:` must require `{required}`: {condition}" + ); + } + assert!( + !condition.contains("always()"), + "always() would publish from a cancelled run: {condition}" + ); + let permissions = job_mapping(publish, "permissions"); + assert_eq!( + permissions.get("contents").map(String::as_str), + Some("write"), + "pushing to the wiki needs contents: write on this job" + ); + let script = normalized_whitespace(publish); assert!( - publish.contains("name: e2e-consolidated-report-nightly") - && publish.contains(".wiki.git"), + script.contains("name: e2e-consolidated-report-nightly") + && script.contains(".wiki.git"), "the wiki job must download the nightly consolidated artifact and push to the wiki repo" ); + assert!( + script.contains("git push origin HEAD"), + "the wiki job must push the page" + ); + assert!( + script.contains("if ! git clone --depth 1 \"$wiki\" wiki; then") + && script.contains("exit 1 fi"), + "a failed wiki clone must fail the job with the prerequisite, not be ignored" + ); + assert!( + script.contains("No per-platform report.json files were found") + && script.contains("leaving the wiki page unchanged"), + "an empty consolidation must leave the last good page in place" + ); assert!( !publish.contains("git init"), - "git init cannot create the remote wiki; a missing wiki must fail with the prerequisite" + "no `git init` fallback: it cannot create a remote wiki" ); } From 7f2caca4e43e3848134e75a118be753f99792478 Mon Sep 17 00:00:00 2001 From: fredespi Date: Thu, 8 Oct 2026 12:43:38 +0200 Subject: [PATCH 5/7] test(xtask): run the wiki publish guard against the generator's empty output Signed-off-by: fredespi --- xtask/src/workflow_contract.rs | 51 ++++++++++++++++++++++++++++++++++ 1 file changed, 51 insertions(+) diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index 5319d9e871..d0fbdf0205 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1767,6 +1767,57 @@ esac ); } + /// Runs the publish job's real empty-report guard against the generator's + /// real empty output, so rewording either side (or breaking the guard's + /// exit) is caught by behavior rather than by pinning strings. + #[cfg(unix)] + #[test] + fn wiki_publish_guard_stops_on_the_generators_empty_output() { + let nightly = read_workflow("nightly.yml"); + let publish = job_block(&nightly, "publish-e2e-wiki"); + let lines: Vec<&str> = publish.lines().collect(); + let start = lines + .iter() + .position(|l| l.trim_start().starts_with("if grep -q 'No per-platform")) + .expect("publish job has the empty-report guard"); + let end = start + + lines[start..] + .iter() + .position(|l| l.trim() == "fi") + .expect("guard is closed by fi"); + let guard = lines[start..=end].join("\n"); + + let run = |matrix: &str| -> String { + let dir = std::env::temp_dir().join(format!( + "wiki-guard-{}-{}", + std::process::id(), + matrix.len() + )); + std::fs::create_dir_all(dir.join("consolidated")).unwrap(); + std::fs::write(dir.join("consolidated/support-matrix.md"), matrix).unwrap(); + let script = format!("set -euo pipefail\n{guard}\necho REACHED_PUBLISH\n"); + let out = std::process::Command::new("bash") + .arg("-c") + .arg(script) + .current_dir(&dir) + .output() + .expect("run bash"); + let _ = std::fs::remove_dir_all(&dir); + assert!(out.status.success(), "guard script failed: {out:?}"); + String::from_utf8_lossy(&out.stdout).into_owned() + }; + + let empty = e2e_report::consolidated_summary_markdown(&[]); + assert!( + !run(&empty).contains("REACHED_PUBLISH"), + "the generator's empty output must stop the publish" + ); + assert!( + run("## E2E consolidated report\n\n| Platform | OS |\n").contains("REACHED_PUBLISH"), + "a matrix with platforms must reach the publish step" + ); + } + #[test] fn dispatchable_wsl_nightly_run_has_the_full_nightly_job_budget() { let self_hosted = read_workflow("e2e-selfhosted.yml"); From 8e04662d65d7d463aa684120b02af2e496e673bd Mon Sep 17 00:00:00 2001 From: fredespi Date: Thu, 8 Oct 2026 13:44:07 +0200 Subject: [PATCH 6/7] test(xtask): pin the nightly step summary and use tempfile in the guard test Signed-off-by: fredespi --- xtask/src/workflow_contract.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index d0fbdf0205..0844e4171f 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1713,6 +1713,10 @@ esac "the consolidated report job must redirect the markdown matrix into \ consolidated/support-matrix.md for the wiki job" ); + assert!( + report.contains("cat consolidated/support-matrix.md >> \"$GITHUB_STEP_SUMMARY\""), + "the nightly step summary must still receive the matrix" + ); let publish = job_block(&nightly, "publish-e2e-wiki"); assert_eq!( job_scalar(publish, "needs"), @@ -1788,21 +1792,17 @@ esac let guard = lines[start..=end].join("\n"); let run = |matrix: &str| -> String { - let dir = std::env::temp_dir().join(format!( - "wiki-guard-{}-{}", - std::process::id(), - matrix.len() - )); + let tmp = tempfile::tempdir().unwrap(); + let dir = tmp.path(); std::fs::create_dir_all(dir.join("consolidated")).unwrap(); std::fs::write(dir.join("consolidated/support-matrix.md"), matrix).unwrap(); let script = format!("set -euo pipefail\n{guard}\necho REACHED_PUBLISH\n"); let out = std::process::Command::new("bash") .arg("-c") .arg(script) - .current_dir(&dir) + .current_dir(dir) .output() .expect("run bash"); - let _ = std::fs::remove_dir_all(&dir); assert!(out.status.success(), "guard script failed: {out:?}"); String::from_utf8_lossy(&out.stdout).into_owned() }; From 5d11b50d7260d4fe97af3d8c4bd49bb811aa479e Mon Sep 17 00:00:00 2001 From: fredespi Date: Thu, 8 Oct 2026 14:57:44 +0200 Subject: [PATCH 7/7] ci(nightly): publish only when the matrix table is present; drop the dead no-change branch Signed-off-by: fredespi --- .github/workflows/nightly.yml | 13 +++++-------- xtask/src/workflow_contract.rs | 12 ++++++++++-- 2 files changed, 15 insertions(+), 10 deletions(-) diff --git a/.github/workflows/nightly.yml b/.github/workflows/nightly.yml index 9d438e0949..b3fd86ed8a 100644 --- a/.github/workflows/nightly.yml +++ b/.github/workflows/nightly.yml @@ -1660,10 +1660,11 @@ jobs: COMMIT_URL: ${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }} run: | set -euo pipefail - # An empty consolidation exits 0 upstream; do not replace the last - # good page with a matrix that has no platforms in it. - if grep -q 'No per-platform report.json files were found' consolidated/support-matrix.md; then - echo "::warning::No platform reports were consolidated; leaving the wiki page unchanged." + # An empty consolidation exits 0 upstream; publish only when the + # matrix table is present, so any degenerate output (empty file, + # reworded message) leaves the last good page in place. + if ! grep -q '^| Platform | OS |' consolidated/support-matrix.md; then + echo "::warning::No platform table in the consolidated report; leaving the wiki page unchanged." exit 0 fi page=E2E-Support-Matrix.md @@ -1692,9 +1693,5 @@ jobs: git config user.name "github-actions[bot]" git config user.email "41898282+github-actions[bot]@users.noreply.github.com" git add "$page" - if git diff --cached --quiet; then - echo "Wiki page already up to date." - exit 0 - fi git commit -m "Update E2E support matrix from nightly run ${GITHUB_RUN_NUMBER}" git push origin HEAD diff --git a/xtask/src/workflow_contract.rs b/xtask/src/workflow_contract.rs index 0844e4171f..cb6f594d75 100644 --- a/xtask/src/workflow_contract.rs +++ b/xtask/src/workflow_contract.rs @@ -1761,7 +1761,8 @@ esac "a failed wiki clone must fail the job with the prerequisite, not be ignored" ); assert!( - script.contains("No per-platform report.json files were found") + script + .contains("if ! grep -q '^| Platform | OS |' consolidated/support-matrix.md; then") && script.contains("leaving the wiki page unchanged"), "an empty consolidation must leave the last good page in place" ); @@ -1782,7 +1783,10 @@ esac let lines: Vec<&str> = publish.lines().collect(); let start = lines .iter() - .position(|l| l.trim_start().starts_with("if grep -q 'No per-platform")) + .position(|l| { + l.trim_start() + .starts_with("if ! grep -q '^| Platform | OS |'") + }) .expect("publish job has the empty-report guard"); let end = start + lines[start..] @@ -1812,6 +1816,10 @@ esac !run(&empty).contains("REACHED_PUBLISH"), "the generator's empty output must stop the publish" ); + assert!( + !run("").contains("REACHED_PUBLISH"), + "a zero-byte matrix must not be published" + ); assert!( run("## E2E consolidated report\n\n| Platform | OS |\n").contains("REACHED_PUBLISH"), "a matrix with platforms must reach the publish step"