Skip to content

Commit b50dbed

Browse files
Sivasuntharampillai, HareshSivasuntharampillai, Haresh
authored andcommitted
Added Workflows to Project Subfolders
1 parent 1d8e07d commit b50dbed

File tree

24 files changed

+1202
-4
lines changed

24 files changed

+1202
-4
lines changed

projects/rocprofiler-compute/.github/workflows/rocprofiler-compute-docs.yml renamed to .github/workflows/rocprofiler-compute-docs.yml

File renamed without changes.

.github/workflows/rocprofiler-systems-containers.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -71,7 +71,7 @@ jobs:
7171
timeout_minutes: 45
7272
max_attempts: 3
7373
command: |
74-
projects/rocprofiler-systems/docker
74+
pushd projects/rocprofiler-systems/docker
7575
./build-docker-ci.sh --distro ${{ matrix.distro }} --versions ${{ matrix.version }} --user ${{ secrets.DOCKERHUB_USERNAME }} --push --jobs 2 --elfutils-version 0.186 --boost-version 1.79.0
7676
popd
7777
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: "CodeQL Advanced"
2+
3+
on:
4+
push:
5+
branches: [ "amd-staging" ]
6+
pull_request:
7+
branches: [ "amd-staging" ]
8+
schedule:
9+
- cron: '0 0 * * *'
10+
11+
env:
12+
EXCLUDED_PATHS: ""
13+
14+
jobs:
15+
analyze:
16+
name: Analyze (${{ matrix.language }})
17+
# Runner size impacts CodeQL analysis time. To learn more, please see:
18+
# - https://gh.io/recommended-hardware-resources-for-running-codeql
19+
# - https://gh.io/supported-runners-and-hardware-resources
20+
# - https://gh.io/using-larger-runners (GitHub.com only)
21+
# Consider using larger runners or machines with greater resources for possible analysis time improvements.
22+
runs-on: AMD-ROCm-Internal-dev1
23+
container: rocm/dev-ubuntu-22.04:latest
24+
permissions:
25+
# required for all workflows
26+
security-events: write
27+
28+
# required to fetch internal or private CodeQL packs
29+
packages: read
30+
31+
# only required for workflows in private repositories
32+
actions: read
33+
contents: read
34+
35+
strategy:
36+
fail-fast: false
37+
matrix:
38+
include:
39+
- language: c-cpp
40+
build-mode: manual
41+
- language: python
42+
build-mode: none
43+
- language: actions
44+
build-mode: none
45+
46+
steps:
47+
- name: Install OS requirements
48+
timeout-minutes: 10
49+
shell: bash
50+
run: |
51+
sudo apt update
52+
sudo apt install -y software-properties-common
53+
sudo apt-add-repository ppa:git-core/ppa
54+
sudo apt-get update
55+
sudo apt install -y git
56+
57+
- name: Checkout repository
58+
uses: actions/checkout@v4
59+
60+
- if: matrix.build-mode == 'manual'
61+
name: Install requirements
62+
timeout-minutes: 10
63+
shell: bash
64+
run: |
65+
git config --global --add safe.directory '*'
66+
apt-get update
67+
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libdw-dev rocm-llvm-dev libgtest-dev libgmock-dev
68+
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
69+
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
70+
71+
# Initializes the CodeQL tools for scanning.
72+
- name: Initialize CodeQL
73+
uses: github/codeql-action/init@v3
74+
with:
75+
languages: ${{ matrix.language }}
76+
build-mode: ${{ matrix.build-mode }}
77+
queries: security-extended
78+
# If you wish to specify custom queries, you can do so here or in a config file.
79+
# By default, queries listed here will override any specified in a config file.
80+
# Prefix the list here with "+" to use these queries and those in the config file.
81+
82+
# 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
83+
# queries: security-extended,security-and-quality
84+
85+
# If the analyze step fails for one of the languages you are analyzing with
86+
# "We were unable to automatically build your code", modify the matrix above
87+
# to set the build mode to "manual" for that language. Then modify this step
88+
# to build your code.
89+
# ℹ️ Command-line programs to run using the OS shell.
90+
# 📚 See https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actions#jobsjob_idstepsrun
91+
- if: matrix.build-mode == 'manual'
92+
name: Configure and Build
93+
timeout-minutes: 30
94+
shell: bash
95+
run: |
96+
cmake -B /tmp/build -DGPU_TARGETS='gfx906,gfx90a,gfx942,gfx1101,gfx1201' -DCMAKE_PREFIX_PATH=/opt/rocm
97+
cmake --build /tmp/build --target all --parallel 16
98+
99+
- name: Perform CodeQL Analysis
100+
uses: github/codeql-action/analyze@v3
101+
with:
102+
category: "/language:${{matrix.language}}"
Lines changed: 149 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,149 @@
1+
name: Continuous Integration
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches: [ amd-staging, amd-mainline, amd-npi ]
7+
paths-ignore:
8+
- '*.md'
9+
- 'source/docs/**'
10+
- 'CODEOWNERS'
11+
pull_request:
12+
paths-ignore:
13+
- '*.md'
14+
- 'source/docs/**'
15+
- 'CODEOWNERS'
16+
17+
concurrency:
18+
group: ${{ github.workflow }}-${{ github.ref }}
19+
cancel-in-progress: true
20+
21+
env:
22+
# TODO(jrmadsen): replace LD_RUNPATH_FLAG, GPU_TARGETS, etc. with internal handling in cmake
23+
PATH: "/usr/bin:$PATH"
24+
navi3_EXCLUDE_TESTS_REGEX: ""
25+
vega20_EXCLUDE_TESTS_REGEX: ""
26+
mi200_EXCLUDE_TESTS_REGEX: ""
27+
mi300_EXCLUDE_TESTS_REGEX: ""
28+
mi300a_EXCLUDE_TESTS_REGEX: ""
29+
mi325_EXCLUDE_TESTS_REGEX: ""
30+
navi4_EXCLUDE_TESTS_REGEX: ""
31+
navi3_EXCLUDE_LABEL_REGEX: ""
32+
vega20_EXCLUDE_LABEL_REGEX: ""
33+
mi200_EXCLUDE_LABEL_REGEX: ""
34+
mi300_EXCLUDE_LABEL_REGEX: ""
35+
mi300a_EXCLUDE_LABEL_REGEX: ""
36+
mi325_EXCLUDE_LABEL_REGEX: ""
37+
navi4_EXCLUDE_LABEL_REGEX: ""
38+
39+
jobs:
40+
core-deb:
41+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
42+
strategy:
43+
fail-fast: false
44+
matrix:
45+
runner: ['navi4', 'navi3', 'mi300']
46+
os: ['ubuntu-22.04']
47+
build-type: ['RelWithDebInfo']
48+
49+
runs-on: ${{ matrix.runner }}${{ github.ref == 'refs/heads/amd-npi' && '-npi' || '' }}-emu-runner-set
50+
if: github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile'
51+
52+
permissions:
53+
contents: read
54+
pull-requests: write
55+
56+
# define this for containers
57+
env:
58+
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
59+
CORE_EXT_RUNNER: mi300a
60+
61+
steps:
62+
- uses: actions/checkout@v4
63+
64+
- name: Install requirements
65+
timeout-minutes: 10
66+
shell: bash
67+
run: |
68+
git config --global --add safe.directory '*'
69+
apt-get update
70+
apt-get install -y build-essential cmake g++-11 g++-12 python3-pip libgtest-dev libgmock-dev
71+
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
72+
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
73+
74+
- name: List Files
75+
shell: bash
76+
run: |
77+
echo "PATH: ${PATH}"
78+
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
79+
which-realpath() { echo -e "\n$1 resolves to $(realpath $(which $1))"; echo "$($(which $1) --version &> /dev/stdout | head -n 1)"; }
80+
for i in python3 git cmake ctest gcc g++ gcov; do which-realpath $i; done
81+
cat /opt/rocm/.info/version
82+
ls -la
83+
pwd
84+
85+
- name: Configure, Build, and Test
86+
timeout-minutes: 30
87+
shell: bash
88+
run:
89+
LD_LIBRARY_PATH=$(pwd)/build:$LD_LIBRARY_PATH ctest --output-on-failure -V -DCTEST_SOURCE_DIRECTORY="$(pwd)"
90+
-DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" -DCTEST_SITE="${RUNNER_HOSTNAME}"
91+
-DCTEST_BUILD_NAME=PR_${{ github.ref_name }}_${{ github.repository }}-${{ matrix.os }}-${{ matrix.runner }}-core
92+
-DCMAKE_CTEST_ARGUMENTS=""
93+
-DAQLPROFILE_BUILD_TESTS=ON
94+
-DAQLPROFILE_EXTRA_CONFIGURE_ARGS=""
95+
-S ./dashboard.cmake
96+
97+
core-rpm:
98+
if: github.ref != 'refs/heads/amd-npi' && github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile'
99+
# See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
100+
strategy:
101+
fail-fast: false
102+
matrix:
103+
runner: ['mi300']
104+
os: ['rhel', 'sles']
105+
build-type: ['RelWithDebInfo']
106+
ci-flags: ['--linter clang-tidy']
107+
108+
runs-on: ${{ matrix.os }}-emu-runner-set
109+
110+
permissions:
111+
contents: read
112+
pull-requests: write
113+
114+
# define this for containers
115+
env:
116+
GIT_DISCOVERY_ACROSS_FILESYSTEM: 1
117+
CORE_EXT_RUNNER: mi300
118+
119+
steps:
120+
- uses: actions/checkout@v4
121+
122+
- name: Install requirements
123+
timeout-minutes: 10
124+
shell: bash
125+
run: |
126+
git config --global --add safe.directory '*'
127+
128+
- name: List Files
129+
shell: bash
130+
run: |
131+
echo "PATH: ${PATH}"
132+
echo "LD_LIBRARY_PATH: ${LD_LIBRARY_PATH}"
133+
which-realpath() { echo -e "\n$1 resolves to $(realpath $(which $1))"; echo "$($(which $1) --version &> /dev/stdout | head -n 1)"; }
134+
for i in python3 git cmake ctest gcc g++ gcov; do which-realpath $i; done
135+
cat /opt/rocm/.info/version
136+
ls -la
137+
pwd
138+
139+
- name: Configure, Build, and Test
140+
timeout-minutes: 30
141+
shell: bash
142+
run:
143+
LD_LIBRARY_PATH=$(pwd)/build:$LD_LIBRARY_PATH ctest --output-on-failure -V -DCTEST_SOURCE_DIRECTORY="$(pwd)"
144+
-DCTEST_BINARY_DIRECTORY="$(pwd)/build" -DAQLPROFILE_BUILD_NUM_JOBS="16" -DCTEST_SITE="${RUNNER_HOSTNAME}"
145+
-DCTEST_BUILD_NAME=PR_${{ github.ref_name }}_${{ github.repository }}-${{ matrix.os }}-${{ matrix.runner }}-core
146+
-DCMAKE_CTEST_ARGUMENTS=""
147+
-DAQLPROFILE_BUILD_TESTS=ON
148+
-DAQLPROFILE_EXTRA_CONFIGURE_ARGS=""
149+
-S ./dashboard.cmake
Lines changed: 102 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,102 @@
1+
name: Close external PR
2+
3+
on:
4+
pull_request_target:
5+
types: [closed]
6+
branches:
7+
- amd-staging
8+
9+
jobs:
10+
git-mirror:
11+
runs-on: ubuntu-latest
12+
if: github.event.pull_request.head.repo.full_name == 'AMD-ROCm-Internal/aqlprofile' && contains(github.event.pull_request.head.ref, 'external-pr')
13+
steps:
14+
- name: Get Current PR Body
15+
id: current_pr
16+
run: |
17+
# Use the PR body directly from the event payload
18+
# This is the body as it was when the 'opened' or 'edited' event was triggered.
19+
RAW_PR_BODY="${{ github.event.pull_request.body }}"
20+
21+
# Handle cases where the body might be null (e.g., an empty PR description)
22+
# In bash, an unset or null variable in quotes becomes an empty string,
23+
# but it's good practice to be explicit or test.
24+
# If RAW_PR_BODY is null from the JSON payload, it will be treated as an empty string here by bash.
25+
# For more robust null handling if needed elsewhere: PR_BODY_FOR_SCRIPT="${RAW_PR_BODY:-}"
26+
PR_BODY_FOR_SCRIPT="$RAW_PR_BODY"
27+
28+
echo "PR Body from event payload (first 500 chars):"
29+
echo "${PR_BODY_FOR_SCRIPT:0:500}" # Print a snippet for logging
30+
echo "-------------------"
31+
32+
# If you need to pass this body to subsequent steps via GITHUB_OUTPUT,
33+
# the multiline escaping is still crucial.
34+
ESCAPED_PR_BODY="${RAW_PR_BODY//'%'/'%25'}"
35+
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\n'/'%0A'}"
36+
ESCAPED_PR_BODY="${ESCAPED_PR_BODY//$'\r'/'%0D'}"
37+
38+
echo "PR_BODY_CONTENT<<EOF" >> $GITHUB_OUTPUT
39+
echo "$ESCAPED_PR_BODY" >> $GITHUB_OUTPUT
40+
echo "EOF" >> $GITHUB_OUTPUT
41+
42+
- name: Extract Remote PR URL and Info
43+
id: remote_pr_info
44+
run: |
45+
PR_BODY="${{ steps.current_pr.outputs.PR_BODY_CONTENT }}"
46+
echo "Current PR Body:"
47+
echo "${PR_BODY}"
48+
echo "-------------------"
49+
50+
# Regex to find GitHub PR URLs. This is a common pattern.
51+
# It captures owner, repo, and pr_number.
52+
REMOTE_PR_URL_REGEX="https://github.com/([^/]+)/([^/]+)/pull/([0-9]+)"
53+
54+
if [[ "$PR_BODY" =~ $REMOTE_PR_URL_REGEX ]]; then
55+
REMOTE_PR_URL="${BASH_REMATCH[0]}"
56+
REMOTE_OWNER="${BASH_REMATCH[1]}"
57+
REMOTE_REPO="${BASH_REMATCH[2]}"
58+
REMOTE_PR_NUMBER="${BASH_REMATCH[3]}"
59+
60+
echo "Found Remote PR URL: $REMOTE_PR_URL"
61+
echo "Remote Owner: $REMOTE_OWNER"
62+
echo "Remote Repo: $REMOTE_REPO"
63+
echo "Remote PR Number: $REMOTE_PR_NUMBER"
64+
65+
echo "REMOTE_PR_URL=$REMOTE_PR_URL" >> $GITHUB_OUTPUT
66+
echo "REMOTE_OWNER=$REMOTE_OWNER" >> $GITHUB_OUTPUT
67+
echo "REMOTE_REPO=$REMOTE_REPO" >> $GITHUB_OUTPUT
68+
echo "REMOTE_PR_NUMBER=$REMOTE_PR_NUMBER" >> $GITHUB_OUTPUT
69+
echo "FOUND_URL=true" >> $GITHUB_OUTPUT
70+
else
71+
echo "::warning::No GitHub PR URL found in the current PR body."
72+
echo "FOUND_URL=false" >> $GITHUB_OUTPUT
73+
fi
74+
75+
- name: Output Results
76+
if: steps.remote_pr_info.outputs.FOUND_URL == 'true'
77+
run: |
78+
echo "Successfully retrieved branch info from remote PR."
79+
echo "Remote PR URL: ${{ steps.remote_pr_info.outputs.REMOTE_PR_URL }}"
80+
81+
- name: Handle No URL Found
82+
if: steps.remote_pr_info.outputs.FOUND_URL == 'false'
83+
run: |
84+
echo "No remote PR URL was found in the body of PR #${{ github.event.pull_request.number }}."
85+
86+
- name: Comment on and Close External PR
87+
if: steps.remote_pr_info.outputs.FOUND_URL == 'true'
88+
env:
89+
GH_TOKEN: ${{ secrets.EXT_TOKEN }}
90+
EXTERNAL_PR_NUMBER: ${{ steps.remote_pr_info.outputs.REMOTE_PR_NUMBER }}
91+
EXTERNAL_REPO: "ROCm/aqlprofile"
92+
run: |
93+
COMMENT_BODY="This pull request has been closed in the internal repository. Thank you for your contribution!"
94+
95+
gh pr comment "$EXTERNAL_PR_NUMBER" \
96+
--repo "$EXTERNAL_REPO" \
97+
--body "$COMMENT_BODY"
98+
99+
gh pr close "$EXTERNAL_PR_NUMBER" \
100+
--repo "$EXTERNAL_REPO"
101+
102+
echo "Commented on and Closed external PR #${EXTERNAL_PR_NUMBER}"

0 commit comments

Comments
 (0)