Copying updates from rocm-libraries
This commit is contained in:
@@ -34,7 +34,7 @@ concurrency:
|
||||
jobs:
|
||||
dispatch-azure-ci:
|
||||
name: Trigger Azure CI
|
||||
if: github.repository == 'ROCm/rocm-systems'
|
||||
if: github.repository == 'ROCm/rocm-systems' && github.event.pull_request.draft == false
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Generate a token
|
||||
@@ -108,7 +108,7 @@ jobs:
|
||||
res=$(curl -sSX GET "https://dev.azure.com/ROCm-CI/ROCm-CI/_apis/build/builds?$pr_filter_query" \
|
||||
-H "Content-Type: application/json")
|
||||
|
||||
runs=$(echo "$res" | jq -r ".value[] | select(.status == \"inProgress\" or .status == \"notStarted\") | .id")
|
||||
runs=$(echo "$res" | jq -r ".value[] | select((.status == \"inProgress\" or .status == \"notStarted\") and .definition.name != \"rocm-ci-caller\") | .id")
|
||||
|
||||
if [ -z "$runs" ]; then
|
||||
echo "No in-progress/not-started runs found for ROCm/rocm-systems PR #$pr_number"
|
||||
@@ -262,6 +262,7 @@ jobs:
|
||||
- name: Create summary check
|
||||
env:
|
||||
GH_TOKEN: ${{ steps.generate-token.outputs.token }}
|
||||
PR_TITLE: ${{ toJSON(github.event.pull_request.title) }}
|
||||
run: |
|
||||
if [[ -n "${{ steps.dispatch.outputs.run_ids }}" && -n "${{ steps.dispatch.outputs.project_names }}" ]]; then # If new runs were started
|
||||
run_ids=(${{ steps.dispatch.outputs.run_ids }})
|
||||
@@ -272,8 +273,7 @@ jobs:
|
||||
success_run_ids=(${{ steps.rerun-failed.outputs.success_run_ids }})
|
||||
success_project_names=(${{ steps.rerun-failed.outputs.success_project_names }})
|
||||
else
|
||||
echo "No run IDs or project names found, skipping summary check creation."
|
||||
exit 0
|
||||
echo "No run IDs or project names found, creating empty summary check."
|
||||
fi
|
||||
|
||||
pr_number=${{ github.event.pull_request.number }}
|
||||
@@ -282,9 +282,24 @@ jobs:
|
||||
|
||||
newline=$'\n'
|
||||
|
||||
summary="PR: [${{ github.event.pull_request.title }} #$pr_number](${{ github.event.pull_request.html_url }})${newline}${newline}"
|
||||
summary="PR: [$PR_TITLE #$pr_number](${{ github.event.pull_request.html_url }})${newline}${newline}"
|
||||
summary+="HEAD: [$pr_head_sha](https://github.com/ROCm/rocm-systems/commit/$pr_head_sha)${newline}${newline}"
|
||||
summary+="MERGE: [$pr_merge_sha](https://github.com/ROCm/rocm-systems/commit/$pr_merge_sha)${newline}${newline}"
|
||||
|
||||
if [[ -z "${run_ids[*]}" && -z "${success_run_ids[*]}" ]]; then
|
||||
summary+="### No Azure CI runs were started for this PR.${newline}${newline}"
|
||||
gh_output=$(gh api repos/ROCm/rocm-systems/check-runs \
|
||||
-f "name=Azure CI Summary" \
|
||||
-f "head_sha=$pr_head_sha" \
|
||||
-f "status=completed" \
|
||||
-f "conclusion=neutral" \
|
||||
-f "output[title]=Azure CI Summary" \
|
||||
-f "output[summary]=$summary")
|
||||
echo "Created empty summary check with ID: $(echo "$gh_output" | jq -r '.id')"
|
||||
echo "Summary check URL: https://github.com/ROCm/rocm-systems/pull/$pr_number/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
summary+="### Pipelines triggered for this PR${newline}${newline}"
|
||||
summary+="| Project | Run ID | Status |${newline}"
|
||||
summary+="|--------------|--------|--------|${newline}"
|
||||
@@ -327,4 +342,4 @@ jobs:
|
||||
-f "output[text]=$text")
|
||||
|
||||
echo "Created summary check with ID: $(echo "$gh_output" | jq -r '.id')"
|
||||
echo "Summary check URL: https://github.com/ROCm/rocm-systems/pull/561/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')"
|
||||
echo "Summary check URL: https://github.com/ROCm/rocm-systems/pull/$pr_number/checks?check_run_id=$(echo "$gh_output" | jq -r '.id')"
|
||||
|
||||
@@ -89,9 +89,6 @@ jobs:
|
||||
# this env clause gets repeated, but it is safer than echo'ing secrets in the workflow
|
||||
GH_TOKEN: ${{ github.event.pull_request.head.repo.fork && secrets.GITHUB_TOKEN || steps.generate-token.outputs.token }}
|
||||
run: |
|
||||
if [ -n "${{ steps.compute_labels.outputs.label_remove }}" ]; then
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "${{ steps.compute_labels.outputs.label_remove }}"
|
||||
fi
|
||||
if [ -n "${{ steps.compute_labels.outputs.label_add }}" ]; then
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --add-label "${{ steps.compute_labels.outputs.label_add }}"
|
||||
fi
|
||||
@@ -110,21 +107,17 @@ jobs:
|
||||
|
||||
if [ "${{ github.event.pull_request.head.repo.fork }}" = true ]; then
|
||||
# For fork PRs: check if user has any collaborator permission on the repo
|
||||
PERMISSION=$(gh api repos/${{ github.repository }}/collaborators/$PR_USER/permission --jq '.permission' --silent)
|
||||
PERMISSION=$(gh api repos/${{ github.repository }}/collaborators/$PR_USER/permission --jq '.permission')
|
||||
if [ "$PERMISSION" = "admin" ] || [ "$PERMISSION" = "write" ] || [ "$PERMISSION" = "maintain" ]; then
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --add-label "${{ env.ORG_LABEL }}"
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "${{ env.EXTERNAL_LABEL }}"
|
||||
else
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --add-label "${{ env.EXTERNAL_LABEL }}"
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "${{ env.ORG_LABEL }}"
|
||||
fi
|
||||
else
|
||||
# For branch PRs (non-forks): check org membership via GitHub App token
|
||||
if gh api orgs/${{ env.ORG_TO_CHECK }}/members/$PR_USER --silent; then
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --add-label "${{ env.ORG_LABEL }}"
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "${{ env.EXTERNAL_LABEL }}"
|
||||
else
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --add-label "${{ env.EXTERNAL_LABEL }}"
|
||||
gh pr edit "${{ github.event.pull_request.number }}" --remove-label "${{ env.ORG_LABEL }}"
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -46,7 +46,7 @@ jobs:
|
||||
.github
|
||||
${{ inputs.subtree_checkout }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
|
||||
- name: Checkout TheRock repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
@@ -66,7 +66,7 @@ jobs:
|
||||
echo "Git version: $(git --version)"
|
||||
git config --global --add safe.directory $PWD
|
||||
git config fetch.parallel 10
|
||||
|
||||
|
||||
- name: Fetch sources
|
||||
run: |
|
||||
./TheRock/build_tools/fetch_sources.py --jobs 12 --no-include-math-libs
|
||||
@@ -151,5 +151,5 @@ jobs:
|
||||
with:
|
||||
project_to_test: ${{ inputs.project_to_test }}
|
||||
amdgpu_families: "gfx94X-dcgpu"
|
||||
test_runs_on: "linux-mi300-1gpu-ossci-rocm"
|
||||
test_runs_on: "linux-mi325-1gpu-ossci-rocm"
|
||||
platform: "linux"
|
||||
|
||||
@@ -48,7 +48,7 @@ jobs:
|
||||
.github
|
||||
${{ inputs.subtree_checkout }}
|
||||
token: ${{ steps.generate-token.outputs.token }}
|
||||
|
||||
|
||||
- name: Checkout TheRock repository
|
||||
uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
|
||||
with:
|
||||
|
||||
@@ -120,3 +120,24 @@ jobs:
|
||||
cmake_options: ${{ matrix.projects.cmake_options }}
|
||||
project_to_test: ${{ matrix.projects.project_to_test }}
|
||||
subtree_checkout: ${{ matrix.projects.subtree_checkout }}
|
||||
|
||||
therock_ci_summary:
|
||||
name: TheRock CI Summary
|
||||
if: always()
|
||||
needs:
|
||||
- setup
|
||||
- therock-ci-linux
|
||||
- therock-ci-windows
|
||||
runs-on: ubuntu-24.04
|
||||
steps:
|
||||
- name: Output failed jobs
|
||||
run: |
|
||||
echo '${{ toJson(needs) }}'
|
||||
FAILED_JOBS="$(echo '${{ toJson(needs) }}' \
|
||||
| jq --raw-output \
|
||||
'map_values(select(.result!="success" and .result!="skipped")) | keys | join(",")' \
|
||||
)"
|
||||
if [[ "${FAILED_JOBS}" != "" ]]; then
|
||||
echo "The following jobs failed: ${FAILED_JOBS}"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user