From c835ca4887174a62089f94fe6877d7becd1041ae Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Wed, 20 May 2026 14:56:52 +0000 Subject: [PATCH 1/5] Bump CI retention days To make it faster and easier to rerun intermittent failing tests --- .github/workflows/rocm-wheels-build.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/rocm-wheels-build.yml b/.github/workflows/rocm-wheels-build.yml index c1a8ea087..f45b4b020 100644 --- a/.github/workflows/rocm-wheels-build.yml +++ b/.github/workflows/rocm-wheels-build.yml @@ -220,7 +220,7 @@ jobs: path: | ${{ runner.temp }}/wheelhouse/*.whl ${{ runner.temp }}/wheelhouse/*.tar.gz - retention-days: 1 + retention-days: 7 if-no-files-found: error - name: Upload build logs on failure From d62a755909142397e5406dd2abc25eef30f8e794 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Wed, 27 May 2026 12:09:11 -0500 Subject: [PATCH 2/5] delete previous artifacts --- .github/workflows/rocm-wheels-build.yml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) diff --git a/.github/workflows/rocm-wheels-build.yml b/.github/workflows/rocm-wheels-build.yml index f45b4b020..f7b9544f1 100644 --- a/.github/workflows/rocm-wheels-build.yml +++ b/.github/workflows/rocm-wheels-build.yml @@ -212,6 +212,31 @@ jobs: find "$LOG_DIR" -type f | sort fi + - name: Delete previous wheel artifacts for this branch + if: success() + env: + GH_TOKEN: ${{ github.token }} + run: | + BRANCH="${{ github.head_ref || github.ref_name }}" + echo "Cleaning up old te-rocm-wheels artifacts for branch: $BRANCH" + + # Collect artifact IDs to delete + IDS=$(gh api --paginate "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels" \ + --jq ".artifacts[] | select(.expired == false and .workflow_run.head_branch == \"$BRANCH\") | .id") + + if [ -z "$IDS" ]; then + echo "No previous artifacts found for this branch." + else + echo "Deleting artifacts:" + for id in $IDS; do + # Log artifact details before deleting + gh api "repos/${{ github.repository }}/actions/artifacts/$id" \ + --jq '"\(.id)\t\(.size_in_bytes / 1024 / 1024 | round)MB\t\(.created_at)"' + gh api -X DELETE "repos/${{ github.repository }}/actions/artifacts/$id" || true + done + echo "Cleanup complete." + fi + - name: Upload wheels as GitHub Actions artifacts if: success() uses: actions/upload-artifact@v4 From d9ee2174298e5502d9760630eacae4cb0ae809a1 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Wed, 27 May 2026 13:33:51 -0500 Subject: [PATCH 3/5] debug --- .github/workflows/rocm-wheels-build.yml | 13 ++++++++++++- 1 file changed, 12 insertions(+), 1 deletion(-) diff --git a/.github/workflows/rocm-wheels-build.yml b/.github/workflows/rocm-wheels-build.yml index f7b9544f1..ea43677d8 100644 --- a/.github/workflows/rocm-wheels-build.yml +++ b/.github/workflows/rocm-wheels-build.yml @@ -217,12 +217,23 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | + set -x BRANCH="${{ github.head_ref || github.ref_name }}" echo "Cleaning up old te-rocm-wheels artifacts for branch: $BRANCH" + echo "Repository: ${{ github.repository }}" + + # Debug: check gh availability and auth + gh --version || echo "WARNING: gh CLI not found" + gh auth status || echo "WARNING: gh auth failed" + + # Debug: show raw API response (first page only, limited fields) + echo "=== Raw API response (first 5 artifacts) ===" + gh api "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels&per_page=5" \ + --jq '.artifacts[] | "\(.id)\t\(.name)\t\(.expired)\t\(.workflow_run.head_branch)"' || echo "WARNING: API call failed with exit code $?" # Collect artifact IDs to delete IDS=$(gh api --paginate "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels" \ - --jq ".artifacts[] | select(.expired == false and .workflow_run.head_branch == \"$BRANCH\") | .id") + --jq ".artifacts[] | select(.expired == false and .workflow_run.head_branch == \"$BRANCH\") | .id") || echo "WARNING: artifact listing failed with exit code $?" if [ -z "$IDS" ]; then echo "No previous artifacts found for this branch." From c91a954c35b6d5dd239ec25f24c99cf3764b4a58 Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Thu, 28 May 2026 10:01:09 -0500 Subject: [PATCH 4/5] bump permissions --- .github/workflows/rocm-ci-dispatch.yml | 1 + .github/workflows/rocm-ci.yml | 4 ++++ .github/workflows/rocm-wheels-build.yml | 4 ++++ 3 files changed, 9 insertions(+) diff --git a/.github/workflows/rocm-ci-dispatch.yml b/.github/workflows/rocm-ci-dispatch.yml index e679ece46..8045e96b4 100644 --- a/.github/workflows/rocm-ci-dispatch.yml +++ b/.github/workflows/rocm-ci-dispatch.yml @@ -9,6 +9,7 @@ on: types: [ labeled, synchronize, reopened ] permissions: + actions: write contents: read jobs: diff --git a/.github/workflows/rocm-ci.yml b/.github/workflows/rocm-ci.yml index e2fb09c15..dea556dad 100644 --- a/.github/workflows/rocm-ci.yml +++ b/.github/workflows/rocm-ci.yml @@ -45,6 +45,10 @@ concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: true +permissions: + actions: write + contents: read + env: TEST_LEVEL: ${{ (github.event_name == 'push' && '3') || inputs.test_level || '1' }} diff --git a/.github/workflows/rocm-wheels-build.yml b/.github/workflows/rocm-wheels-build.yml index ea43677d8..c2a93bf03 100644 --- a/.github/workflows/rocm-wheels-build.yml +++ b/.github/workflows/rocm-wheels-build.yml @@ -70,6 +70,10 @@ env: DOCKER_IMAGE_NAME: te-rocm-manylinux-x86 MANYLINUX_PLATFORM: manylinux_2_28_x86_64 +permissions: + actions: write + contents: read + # ───────────────────────────────────────────────────────────────────────────── jobs: From 77f0a28ca7d22e2eee2df36846c8bececbb6dfef Mon Sep 17 00:00:00 2001 From: Matthias Diener Date: Thu, 28 May 2026 11:06:51 -0500 Subject: [PATCH 5/5] remove debug --- .github/workflows/rocm-wheels-build.yml | 33 ++++++++++++------------- 1 file changed, 16 insertions(+), 17 deletions(-) diff --git a/.github/workflows/rocm-wheels-build.yml b/.github/workflows/rocm-wheels-build.yml index c2a93bf03..e1eeef89e 100644 --- a/.github/workflows/rocm-wheels-build.yml +++ b/.github/workflows/rocm-wheels-build.yml @@ -221,35 +221,34 @@ jobs: env: GH_TOKEN: ${{ github.token }} run: | - set -x BRANCH="${{ github.head_ref || github.ref_name }}" echo "Cleaning up old te-rocm-wheels artifacts for branch: $BRANCH" - echo "Repository: ${{ github.repository }}" - - # Debug: check gh availability and auth - gh --version || echo "WARNING: gh CLI not found" - gh auth status || echo "WARNING: gh auth failed" - - # Debug: show raw API response (first page only, limited fields) - echo "=== Raw API response (first 5 artifacts) ===" - gh api "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels&per_page=5" \ - --jq '.artifacts[] | "\(.id)\t\(.name)\t\(.expired)\t\(.workflow_run.head_branch)"' || echo "WARNING: API call failed with exit code $?" # Collect artifact IDs to delete - IDS=$(gh api --paginate "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels" \ - --jq ".artifacts[] | select(.expired == false and .workflow_run.head_branch == \"$BRANCH\") | .id") || echo "WARNING: artifact listing failed with exit code $?" + if ! IDS=$(gh api --paginate "repos/${{ github.repository }}/actions/artifacts?name=te-rocm-wheels" \ + --jq ".artifacts[] | select(.expired == false and .workflow_run.head_branch == \"$BRANCH\") | .id"); then + echo "::warning::Failed to list artifacts (possible permissions issue). Skipping cleanup." + exit 0 + fi if [ -z "$IDS" ]; then echo "No previous artifacts found for this branch." else echo "Deleting artifacts:" + FAILED=0 for id in $IDS; do - # Log artifact details before deleting gh api "repos/${{ github.repository }}/actions/artifacts/$id" \ - --jq '"\(.id)\t\(.size_in_bytes / 1024 / 1024 | round)MB\t\(.created_at)"' - gh api -X DELETE "repos/${{ github.repository }}/actions/artifacts/$id" || true + --jq '"\(.id)\t\(.size_in_bytes / 1024 / 1024 | round)MB\t\(.created_at)"' || true + if ! gh api -X DELETE "repos/${{ github.repository }}/actions/artifacts/$id"; then + echo "::warning::Failed to delete artifact $id (possible permissions issue)." + FAILED=$((FAILED + 1)) + fi done - echo "Cleanup complete." + if [ "$FAILED" -gt 0 ]; then + echo "::warning::Failed to delete $FAILED artifact(s). Ensure the workflow has 'actions: write' permission." + else + echo "Cleanup complete." + fi fi - name: Upload wheels as GitHub Actions artifacts