Files
rocm-systems/.github/workflows/rocprofiler-compute-formatting.yml
T
cfallows-amd 8bc0063f2e Update rocprofiler-compute workflows and CODEOWNERS (#221)
Update super repo codeowners- add Pratik to any doc changes for rocprofiler-compute.
Remove rocprofiler-compute-mi-rhel9.yml from super repo workflow folder- unused and out of date, coverage is already in RHEL8 workflow.
Remove CODEOWNERS, dependabot.yml, and all workflows from the projects/rocprofiler-compute/ project- confirmed these do not do anything anymore after being copied into super repo's main ./github/ section.

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>

* Add a branch filter for push events

* Update .github/CODEOWNERS

Use reviewers team instead of using the individual profiles.

Co-authored-by: David Galiffi <David.Galiffi@amd.com>

Update owners section for rocprofiler-compute codeowners, fix spacing

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>

---------

Signed-off-by: Carrie Fallows <Carrie.Fallows@amd.com>
Co-authored-by: David Galiffi <David.Galiffi@amd.com>
2025-08-20 11:17:25 -04:00

102 γραμμές
2.9 KiB
YAML

name: rocprofiler-compute Formatting
on:
push:
branches:
- develop
paths:
- 'projects/rocprofiler-compute/**'
pull_request:
paths:
- 'projects/rocprofiler-compute/**'
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
python:
runs-on: ubuntu-22.04
steps:
- name: Checkout
uses: actions/checkout@v4
with:
sparse-checkout: projects/rocprofiler-compute
- name: Set up Python '3.x'
uses: actions/setup-python@v5
with:
python-version: '3.x'
- name: Install dependencies
working-directory: projects/rocprofiler-compute
run: |
python -m pip install --upgrade pip
python -m pip install ruff
if [ -f requirements.txt ]; then python -m pip install -r requirements.txt; fi
- name: Run Ruff Linter and Import Sorter
run: |
ruff check . --fix --exit-zero
- name: Run Ruff Formatter
run: |
ruff format .
- name: Check for formatting/linting changes
run: |
git config --global user.name 'github-actions'
git config --global user.email 'github-actions@github.com'
git add -A .
if ! git diff --cached --quiet; then
echo "::error::Files were modified by ruff. Please run 'ruff check . --fix && ruff format .' locally and commit the changes."
git diff --cached --patch # Show the diff in the logs
exit 1
else
echo "Ruff found no issues or all issues were fixed and files are clean."
fi
cmake:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: projects/rocprofiler-compute
- name: Install dependencies
working-directory: projects/rocprofiler-compute
run: |
sudo apt-get update
sudo apt-get install -y python3-pip
python3 -m pip install cmake-format
- name: cmake-format
working-directory: projects/rocprofiler-compute
run: |
set +e
cmake-format -i $(find . -type f | egrep 'CMakeLists.txt|\.cmake$')
if [ $(git diff | wc -l) -gt 0 ]; then
echo -e "\nError! CMake code not formatted. Run cmake-format...\n"
echo -e "\nFiles:\n"
git diff --name-only
echo -e "\nFull diff:\n"
git diff
exit 1
fi
python-bytecode:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v4
with:
sparse-checkout: projects/rocprofiler-compute
- name: find-bytecode
working-directory: projects/rocprofiler-compute
run: |
set +e
FILES=$(find . -type f | egrep '__pycache__|\.pyc$')
if [ -n "${FILES}" ]; then
echo -e "\nError! Python bytecode included in commit\n"
echo -e "### FILES: ###"
echo -e "${FILES}"
echo -e "##############"
exit 1
fi