Add 'projects/aqlprofile/' from commit '6f236ffb5f1bd128e11ba0bf09e3c0a52b6527e4'

git-subtree-dir: projects/aqlprofile
git-subtree-mainline: 9011821e05
git-subtree-split: 6f236ffb5f
Dieser Commit ist enthalten in:
systems-assistant[bot]
2025-07-22 22:52:36 +00:00
Commit a68afa42a1
179 geänderte Dateien mit 375388 neuen und 0 gelöschten Zeilen
+102
Datei anzeigen
@@ -0,0 +1,102 @@
name: "CodeQL Advanced"
on:
push:
branches: [ "amd-staging" ]
pull_request:
branches: [ "amd-staging" ]
schedule:
- cron: '0 0 * * *'
env:
EXCLUDED_PATHS: ""
jobs:
analyze:
name: Analyze (${{ matrix.language }})
# Runner size impacts CodeQL analysis time. To learn more, please see:
# - https://gh.io/recommended-hardware-resources-for-running-codeql
# - https://gh.io/supported-runners-and-hardware-resources
# - https://gh.io/using-larger-runners (GitHub.com only)
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
runs-on: AMD-ROCm-Internal-dev1
container: rocm/dev-ubuntu-22.04:latest
permissions:
# required for all workflows
security-events: write
# required to fetch internal or private CodeQL packs
packages: read
# only required for workflows in private repositories
actions: read
contents: read
strategy:
fail-fast: false
matrix:
include:
- language: c-cpp
build-mode: manual
- language: python
build-mode: none
- language: actions
build-mode: none
steps:
- name: Install OS requirements
timeout-minutes: 10
shell: bash
run: |
sudo apt update
sudo apt install -y software-properties-common
sudo apt-add-repository ppa:git-core/ppa
sudo apt-get update
sudo apt install -y git
- name: Checkout repository
uses: actions/checkout@v4
- if: matrix.build-mode == 'manual'
name: Install requirements
timeout-minutes: 10
shell: bash
run: |
git config --global --add safe.directory '*'
apt-get update
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev rocm-llvm-dev libgtest-dev libgmock-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
# Initializes the CodeQL tools for scanning.
- name: Initialize CodeQL
uses: github/codeql-action/init@v3
with:
languages: ${{ matrix.language }}
build-mode: ${{ matrix.build-mode }}
queries: security-extended
# If you wish to specify custom queries, you can do so here or in a config file.
# By default, queries listed here will override any specified in a config file.
# Prefix the list here with "+" to use these queries and those in the config file.
# For more details on CodeQL's query packs, refer to: https://docs.github.com/en/code-security/code-scanning/automatically-scanning-your-code-for-vulnerabilities-and-errors/configuring-code-scanning#using-queries-in-ql-packs
# queries: security-extended,security-and-quality
# If the analyze step fails for one of the languages you are analyzing with
# "We were unable to automatically build your code", modify the matrix above
# to set the build mode to "manual" for that language. Then modify this step
# to build your code.
# ️ Command-line programs to run using the OS shell.
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
- if: matrix.build-mode == 'manual'
name: Configure and Build
timeout-minutes: 30
shell: bash
run: |
cmake -B /tmp/build -DGPU_TARGETS='gfx906,gfx90a,gfx942,gfx1101,gfx1201' -DCMAKE_PREFIX_PATH=/opt/rocm
cmake --build /tmp/build --target all --parallel 16
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v3
with:
category: "/language:${{matrix.language}}"
@@ -0,0 +1,149 @@
name: Continuous Integration
on:
workflow_dispatch:
push:
branches: [ amd-staging, amd-mainline, amd-npi ]
paths-ignore:
- '*.md'
- 'source/docs/**'
- 'CODEOWNERS'
pull_request:
paths-ignore:
- '*.md'
- 'source/docs/**'
- 'CODEOWNERS'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
# TODO(jrmadsen): replace LD_RUNPATH_FLAG, GPU_TARGETS, etc. with internal handling in cmake
PATH: "/usr/bin:$PATH"
navi3_EXCLUDE_TESTS_REGEX: ""
vega20_EXCLUDE_TESTS_REGEX: ""
mi200_EXCLUDE_TESTS_REGEX: ""
mi300_EXCLUDE_TESTS_REGEX: ""
mi300a_EXCLUDE_TESTS_REGEX: ""
mi325_EXCLUDE_TESTS_REGEX: ""
navi4_EXCLUDE_TESTS_REGEX: ""
navi3_EXCLUDE_LABEL_REGEX: ""
vega20_EXCLUDE_LABEL_REGEX: ""
mi200_EXCLUDE_LABEL_REGEX: ""
mi300_EXCLUDE_LABEL_REGEX: ""
mi300a_EXCLUDE_LABEL_REGEX: ""
mi325_EXCLUDE_LABEL_REGEX: ""
navi4_EXCLUDE_LABEL_REGEX: ""
jobs:
core-deb:
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
fail-fast: false
matrix:
runner: ['navi4', 'navi3', 'mi300']
os: ['ubuntu-22.04']
build-type: ['RelWithDebInfo']
runs-on: ${{ matrix.runner }}${{ github.ref == 'refs/heads/amd-npi' && '-npi' || '' }}-emu-runner-set
if: github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile'
permissions:
contents: read
pull-requests: write
# define this for containers
env:
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
CORE_EXT_RUNNER: mi300a
steps:
- uses: actions/checkout@v4
- name: Install requirements
timeout-minutes: 10
shell: bash
run: |
git config --global --add safe.directory '*'
apt-get update
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libgtest-dev libgmock-dev
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-11 10 --slave /usr/bin/g++ g++ /usr/bin/g++-11 --slave /usr/bin/gcov gcov /usr/bin/gcov-11
update-alternatives --install /usr/bin/gcc gcc /usr/bin/gcc-12 20 --slave /usr/bin/g++ g++ /usr/bin/g++-12 --slave /usr/bin/gcov gcov /usr/bin/gcov-12
- name: List Files
shell: bash
run: |
echo "PATH: ${PATH}"
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
which-realpath() { echo -e "\n$1 resolves to $(realpath $(which $1))"; echo "$($(which $1) --version &> /dev/stdout | head -n 1)"; }
for i in python3 git cmake ctest gcc g++ gcov; do which-realpath $i; done
cat /opt/rocm/.info/version
ls -la
pwd
- name: Configure, Build, and Test
timeout-minutes: 30
shell: bash
run:
LD_LIBRARY_PATH=$(pwd)/build:$LD_LIBRARY_PATH ctest --output-on-failure -V -DCTEST_SOURCE_DIRECTORY="$(pwd)"
-DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" -DCTEST_SITE="${RUNNER_HOSTNAME}"
-DCTEST_BUILD_NAME=PR_${{ github.ref_name }}_${{ github.repository }}-${{ matrix.os }}-${{ matrix.runner }}-core
-DCMAKE_CTEST_ARGUMENTS=""
-DAQLPROFILE_BUILD_TESTS=ON
-DAQLPROFILE_EXTRA_CONFIGURE_ARGS=""
-S ./dashboard.cmake
core-rpm:
if: github.ref != 'refs/heads/amd-npi' && github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile'
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
strategy:
fail-fast: false
matrix:
runner: ['mi300']
os: ['rhel', 'sles']
build-type: ['RelWithDebInfo']
ci-flags: ['--linter clang-tidy']
runs-on: ${{ matrix.os }}-emu-runner-set
permissions:
contents: read
pull-requests: write
# define this for containers
env:
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
CORE_EXT_RUNNER: mi300
steps:
- uses: actions/checkout@v4
- name: Install requirements
timeout-minutes: 10
shell: bash
run: |
git config --global --add safe.directory '*'
- name: List Files
shell: bash
run: |
echo "PATH: ${PATH}"
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
which-realpath() { echo -e "\n$1 resolves to $(realpath $(which $1))"; echo "$($(which $1) --version &> /dev/stdout | head -n 1)"; }
for i in python3 git cmake ctest gcc g++ gcov; do which-realpath $i; done
cat /opt/rocm/.info/version
ls -la
pwd
- name: Configure, Build, and Test
timeout-minutes: 30
shell: bash
run:
LD_LIBRARY_PATH=$(pwd)/build:$LD_LIBRARY_PATH ctest --output-on-failure -V -DCTEST_SOURCE_DIRECTORY="$(pwd)"
-DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" -DCTEST_SITE="${RUNNER_HOSTNAME}"
-DCTEST_BUILD_NAME=PR_${{ github.ref_name }}_${{ github.repository }}-${{ matrix.os }}-${{ matrix.runner }}-core
-DCMAKE_CTEST_ARGUMENTS=""
-DAQLPROFILE_BUILD_TESTS=ON
-DAQLPROFILE_EXTRA_CONFIGURE_ARGS=""
-S ./dashboard.cmake
@@ -0,0 +1,102 @@
name: Close external PR
on:
pull_request_target:
types: [closed]
branches:
- amd-staging
jobs:
git-mirror:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile' && contains(github.event.pull_request.head.ref, 'external-pr')
steps:
- name: Get Current PR Body
id: current_pr
run: |
# Use the PR body directly from the event payload
# This is the body as it was when the 'opened' or 'edited' event was triggered.
RAW_PR_BODY="${{ github.event.pull_request.body }}"
# Handle cases where the body might be null (e.g., an empty PR description)
# In bash, an unset or null variable in quotes becomes an empty string,
# but it's good practice to be explicit or test.
# If RAW_PR_BODY is null from the JSON payload, it will be treated as an empty string here by bash.
# For more robust null handling if needed elsewhere: PR_BODY_FOR_SCRIPT="${RAW_PR_BODY:-}"
PR_BODY_FOR_SCRIPT="$RAW_PR_BODY"
echo "PR Body from event payload (first 500 chars):"
echo "${PR_BODY_FOR_SCRIPT:0:500}" # Print a snippet for logging
echo "-------------------"
# If you need to pass this body to subsequent steps via GITHUB_OUTPUT,
# the multiline escaping is still crucial.
ESCAPED_PR_BODY="${RAW_PR_BODY//'%'/'%25'}"
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\n'/'%0A'}"
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\r'/'%0D'}"
echo "PR_BODY_CONTENT<<EOF" >> $GITHUB_OUTPUT
echo "$ESCAPED_PR_BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Extract Remote PR URL and Info
id: remote_pr_info
run: |
PR_BODY="${{ steps.current_pr.outputs.PR_BODY_CONTENT }}"
echo "Current PR Body:"
echo "${PR_BODY}"
echo "-------------------"
# Regex to find GitHub PR URLs. This is a common pattern.
# It captures owner, repo, and pr_number.
REMOTE_PR_URL_REGEX="https://github.com/([^/]+)/([^/]+)/pull/([0-9]+)"
if [[ "$PR_BODY" =~ $REMOTE_PR_URL_REGEX ]]; then
REMOTE_PR_URL="${BASH_REMATCH[0]}"
REMOTE_OWNER="${BASH_REMATCH[1]}"
REMOTE_REPO="${BASH_REMATCH[2]}"
REMOTE_PR_NUMBER="${BASH_REMATCH[3]}"
echo "Found Remote PR URL: $REMOTE_PR_URL"
echo "Remote Owner: $REMOTE_OWNER"
echo "Remote Repo: $REMOTE_REPO"
echo "Remote PR Number: $REMOTE_PR_NUMBER"
echo "REMOTE_PR_URL=$REMOTE_PR_URL" >> $GITHUB_OUTPUT
echo "REMOTE_OWNER=$REMOTE_OWNER" >> $GITHUB_OUTPUT
echo "REMOTE_REPO=$REMOTE_REPO" >> $GITHUB_OUTPUT
echo "REMOTE_PR_NUMBER=$REMOTE_PR_NUMBER" >> $GITHUB_OUTPUT
echo "FOUND_URL=true" >> $GITHUB_OUTPUT
else
echo "::warning::No GitHub PR URL found in the current PR body."
echo "FOUND_URL=false" >> $GITHUB_OUTPUT
fi
- name: Output Results
if: steps.remote_pr_info.outputs.FOUND_URL == 'true'
run: |
echo "Successfully retrieved branch info from remote PR."
echo "Remote PR URL: ${{ steps.remote_pr_info.outputs.REMOTE_PR_URL }}"
- name: Handle No URL Found
if: steps.remote_pr_info.outputs.FOUND_URL == 'false'
run: |
echo "No remote PR URL was found in the body of PR #${{ github.event.pull_request.number }}."
- name: Comment on and Close External PR
if: steps.remote_pr_info.outputs.FOUND_URL == 'true'
env:
GH_TOKEN: ${{ secrets.EXT_TOKEN }}
EXTERNAL_PR_NUMBER: ${{ steps.remote_pr_info.outputs.REMOTE_PR_NUMBER }}
EXTERNAL_REPO: "ROCm/aqlprofile"
run: |
COMMENT_BODY="This pull request has been closed in the internal repository. Thank you for your contribution!"
gh pr comment "$EXTERNAL_PR_NUMBER" \
--repo "$EXTERNAL_REPO" \
--body "$COMMENT_BODY"
gh pr close "$EXTERNAL_PR_NUMBER" \
--repo "$EXTERNAL_REPO"
echo "Commented on and Closed external PR #${EXTERNAL_PR_NUMBER}"
@@ -0,0 +1,132 @@
name: Sync external PR branch to public repository
on:
pull_request_target:
branches:
- amd-staging
jobs:
git-mirror:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile' && contains(github.event.pull_request.head.ref, 'external-pr')
steps:
- name: Get Current PR Body
id: current_pr
run: |
# Use the PR body directly from the event payload
# This is the body as it was when the 'opened' or 'edited' event was triggered.
RAW_PR_BODY="${{ github.event.pull_request.body }}"
# Handle cases where the body might be null (e.g., an empty PR description)
# In bash, an unset or null variable in quotes becomes an empty string,
# but it's good practice to be explicit or test.
# If RAW_PR_BODY is null from the JSON payload, it will be treated as an empty string here by bash.
# For more robust null handling if needed elsewhere: PR_BODY_FOR_SCRIPT="${RAW_PR_BODY:-}"
PR_BODY_FOR_SCRIPT="$RAW_PR_BODY"
echo "PR Body from event payload (first 500 chars):"
echo "${PR_BODY_FOR_SCRIPT:0:500}" # Print a snippet for logging
echo "-------------------"
# If you need to pass this body to subsequent steps via GITHUB_OUTPUT,
# the multiline escaping is still crucial.
ESCAPED_PR_BODY="${RAW_PR_BODY//'%'/'%25'}"
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\n'/'%0A'}"
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\r'/'%0D'}"
echo "PR_BODY_CONTENT<<EOF" >> $GITHUB_OUTPUT
echo "$ESCAPED_PR_BODY" >> $GITHUB_OUTPUT
echo "EOF" >> $GITHUB_OUTPUT
- name: Extract Remote PR URL and Info
id: remote_pr_info
run: |
PR_BODY="${{ steps.current_pr.outputs.PR_BODY_CONTENT }}"
echo "Current PR Body:"
echo "${PR_BODY}"
echo "-------------------"
# Regex to find GitHub PR URLs. This is a common pattern.
# It captures owner, repo, and pr_number.
REMOTE_PR_URL_REGEX="https://github.com/([^/]+)/([^/]+)/pull/([0-9]+)"
if [[ "$PR_BODY" =~ $REMOTE_PR_URL_REGEX ]]; then
REMOTE_PR_URL="${BASH_REMATCH[0]}"
REMOTE_OWNER="${BASH_REMATCH[1]}"
REMOTE_REPO="${BASH_REMATCH[2]}"
REMOTE_PR_NUMBER="${BASH_REMATCH[3]}"
echo "Found Remote PR URL: $REMOTE_PR_URL"
echo "Remote Owner: $REMOTE_OWNER"
echo "Remote Repo: $REMOTE_REPO"
echo "Remote PR Number: $REMOTE_PR_NUMBER"
echo "REMOTE_PR_URL=$REMOTE_PR_URL" >> $GITHUB_OUTPUT
echo "REMOTE_OWNER=$REMOTE_OWNER" >> $GITHUB_OUTPUT
echo "REMOTE_REPO=$REMOTE_REPO" >> $GITHUB_OUTPUT
echo "REMOTE_PR_NUMBER=$REMOTE_PR_NUMBER" >> $GITHUB_OUTPUT
echo "FOUND_URL=true" >> $GITHUB_OUTPUT
else
echo "::warning::No GitHub PR URL found in the current PR body."
echo "FOUND_URL=false" >> $GITHUB_OUTPUT
fi
- name: Fetch Remote PR Branch Name
if: steps.remote_pr_info.outputs.FOUND_URL == 'true'
id: remote_pr_branch
env:
GH_TOKEN: ${{ secrets.EXT_TOKEN }}
REMOTE_OWNER: ${{ steps.remote_pr_info.outputs.REMOTE_OWNER }}
REMOTE_REPO: ${{ steps.remote_pr_info.outputs.REMOTE_REPO }}
REMOTE_PR_NUMBER: ${{ steps.remote_pr_info.outputs.REMOTE_PR_NUMBER }}
run: |
if [ -n "$GH_TOKEN" ]; then
echo "Using provided TOKEN."
ACTUAL_GH_TOKEN="$GH_TOKEN"
else
echo "::error::No token available."
exit 1
fi
echo "Fetching branch name for $REMOTE_OWNER/$REMOTE_REPO/pull/$REMOTE_PR_NUMBER"
REMOTE_BRANCH_NAME=$(GH_TOKEN="$ACTUAL_GH_TOKEN" gh pr view "$REMOTE_PR_NUMBER" \
--repo "$REMOTE_OWNER/$REMOTE_REPO" \
--json headRefName --jq .headRefName)
if [ -n "$REMOTE_BRANCH_NAME" ]; then
echo "Remote PR Branch Name: $REMOTE_BRANCH_NAME"
echo "REMOTE_BRANCH_NAME=$REMOTE_BRANCH_NAME" >> $GITHUB_OUTPUT
else
echo "::error::Could not retrieve branch name for remote PR $REMOTE_OWNER/$REMOTE_REPO/pull/$REMOTE_PR_NUMBER. Check PAT permissions or PR validity."
# Optionally exit 1 if this is critical
# exit 1
fi
- name: Output Results
if: steps.remote_pr_info.outputs.FOUND_URL == 'true' && steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME
run: |
echo "Successfully retrieved branch name from remote PR."
echo "Remote PR URL: ${{ steps.remote_pr_info.outputs.REMOTE_PR_URL }}"
echo "Remote PR Branch Name: ${{ steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME }}"
# You can now use ${{ steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME }} in subsequent steps
# For example, create an artifact, comment on PR A, trigger another workflow, etc.
- name: Handle No URL Found
if: steps.remote_pr_info.outputs.FOUND_URL == 'false'
run: |
echo "No remote PR URL was found in the body of PR #${{ github.event.pull_request.number }}."
- name: Handle Branch Not Found
if: steps.remote_pr_info.outputs.FOUND_URL == 'true' && !steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME
run: |
echo "A remote PR URL was found, but its branch name could not be retrieved."
echo "URL: ${{ steps.remote_pr_info.outputs.REMOTE_PR_URL }}"
- name: Sync
if: steps.remote_pr_info.outputs.FOUND_URL == 'true' && steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME
uses: AMD-ROCm-Internal/rocprofiler-github-actions@git-sync-v3
with:
source_repo: "https://${{ secrets.TOKEN }}@github.com/AMD-ROCm-Internal/aqlprofile.git"
source_branch: "${{ github.event.pull_request.head.ref }}"
destination_repo: "https://${{ secrets.EXT_TOKEN }}@github.com/ROCm/aqlprofile.git"
destination_branch: "${{ steps.remote_pr_branch.outputs.REMOTE_BRANCH_NAME }}"
+82
Datei anzeigen
@@ -0,0 +1,82 @@
name: Mirror External PR to Internal Repo
on:
pull_request_target:
types: [opened, synchronize]
branches:
- amd-staging
jobs:
mirror_pr:
runs-on: ubuntu-latest
if: github.event.pull_request.head.repo.full_name != 'AMD-ROCm-Internal/aqlprofile'
steps:
- name: Checkout PR base
uses: actions/checkout@v4
- name: Setup Git User
run: |
git config --global user.name 'External PR Mirror Bot'
git config --global user.email 'bot@users.noreply.github.com'
- uses: wei/git-sync@v3
name: Push branch to Internal Repository
with:
source_repo: "https://${{ secrets.EXTERNAL_REPO_TOKEN }}@github.com/ROCm/aqlprofile.git"
source_branch: "${{ github.event.pull_request.head.ref }}"
destination_repo: "https://${{ secrets.INTERNAL_REPO_TOKEN }}@github.com/AMD-ROCm-Internal/aqlprofile.git"
destination_branch: "external-pr/${{ github.event.pull_request.number }}"
- name: Create Pull Request in Internal Repository
if: ${{ github.event.action == 'opened' }}
id: create_internal_pr
env:
GH_TOKEN: ${{ secrets.INTERNAL_REPO_TOKEN }}
INTERNAL_REPO: "AMD-ROCm-Internal/aqlprofile"
INTERNAL_BASE_BRANCH: "amd-staging"
HEAD_BRANCH: "external-pr/${{ github.event.pull_request.number }}"
PR_TITLE: "Mirror: ${{ github.event.pull_request.title }} (Ext PR #${{ github.event.pull_request.number }})"
PR_BODY: |
This PR mirrors changes from external pull request: ${{ github.event.pull_request.html_url }}
Original PR Body:
-------------------
${{ github.event.pull_request.body }}
run: |
# Create PR and capture its URL
INTERNAL_PR_URL=$(gh pr create \
--repo "$INTERNAL_REPO" \
--base "$INTERNAL_BASE_BRANCH" \
--head "$HEAD_BRANCH" \
--title "$PR_TITLE" \
--body "$PR_BODY")
if [ -z "$INTERNAL_PR_URL" ]; then
echo "Failed to create internal PR. URL is empty."
# Check if PR already exists (gh pr create might not fail if branch has open PR)
EXISTING_PR_URL=$(gh pr list --repo "$INTERNAL_REPO" --head "$HEAD_BRANCH" --json url -q '.[0].url')
if [ -n "$EXISTING_PR_URL" ]; then
echo "Internal PR already exists: $EXISTING_PR_URL"
echo "INTERNAL_PR_URL=$EXISTING_PR_URL" >> $GITHUB_OUTPUT
else
echo "::error::Failed to create or find existing internal PR."
exit 1
fi
fi
- name: Comment on and Close External PR
if: steps.create_internal_pr.outputs.INTERNAL_PR_URL != ''
env:
GH_TOKEN: ${{ secrets.EXTERNAL_REPO_TOKEN }}
EXTERNAL_PR_NUMBER: ${{ github.event.pull_request.number }}
EXTERNAL_REPO: ${{ github.repository }}
run: |
COMMENT_BODY="This pull request has been mirrored to our internal repository for review and integration. Thank you for your contribution!"
gh pr comment "$EXTERNAL_PR_NUMBER" \
--repo "$EXTERNAL_REPO" \
--body "$COMMENT_BODY"
echo "Commented on external PR #${EXTERNAL_PR_NUMBER}"
+16
Datei anzeigen
@@ -0,0 +1,16 @@
name: Rocm Validation Suite KWS
on:
push:
branches: [amd-staging]
pull_request:
types: [opened, synchronize, reopened]
branches: [amd-staging]
workflow_dispatch:
jobs:
kws:
if: ${{ github.event_name == 'pull_request' }}
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/kws.yml@mainline
secrets: inherit
with:
pr_number: ${{github.event.pull_request.number}}
base_branch: ${{github.base_ref}}
@@ -0,0 +1,25 @@
name: ROCm CI Caller
on:
pull_request:
branches: [amd-staging, amd-npi, release/rocm-rel-*]
types: [opened, reopened, synchronize]
push:
branches: [amd-mainline]
workflow_dispatch:
issue_comment:
types: [created]
jobs:
call-workflow:
if: ${{ github.event_name != 'issue_comment' || github.event.comment.body == '!verify' }}
uses: AMD-ROCm-Internal/rocm_ci_infra/.github/workflows/rocm_ci.yml@mainline
secrets: inherit
with:
input_sha: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
input_pr_num: ${{ github.event_name == 'pull_request' && github.event.pull_request.number || 0 }}
input_pr_url: ${{ github.event_name == 'pull_request' && github.event.pull_request.html_url || '' }}
input_pr_title: ${{ github.event_name == 'pull_request' && github.event.pull_request.title || '' }}
repository_name: ${{ github.repository }}
base_ref: ${{ github.event_name == 'pull_request' && github.base_ref || github.ref }}
trigger_event_type: ${{ github.event_name }}
@@ -0,0 +1,17 @@
name: Sync amd-mainline to public repository
on:
push:
branches: [ amd-mainline ]
jobs:
git-mirror:
runs-on: AMD-ROCm-Internal-dev1
steps:
- name: git-sync
uses: AMD-ROCm-Internal/rocprofiler-github-actions@git-sync-v3
with:
source_repo: "https://${{ secrets.TOKEN }}@github.com/AMD-ROCm-Internal/aqlprofile.git"
source_branch: "amd-mainline"
destination_repo: "https://${{ secrets.EXT_TOKEN }}@github.com/ROCm/aqlprofile.git"
destination_branch: "amd-mainline"
@@ -0,0 +1,17 @@
name: Sync amd-staging to public repository
on:
push:
branches: [ amd-staging ]
jobs:
git-mirror:
runs-on: AMD-ROCm-Internal-dev1
steps:
- name: git-sync
uses: AMD-ROCm-Internal/rocprofiler-github-actions@git-sync-v3
with:
source_repo: "https://${{ secrets.TOKEN }}@github.com/AMD-ROCm-Internal/aqlprofile.git"
source_branch: "amd-staging"
destination_repo: "https://${{ secrets.EXT_TOKEN }}@github.com/ROCm/aqlprofile.git"
destination_branch: "amd-staging"