CodeQL / Analyze (actions) (push) Canceled after 0s
CodeQL / Analyze (python) (push) Canceled after 0s
pre-commit / pre-commit (push) Canceled after 0s
Multi-Arch CI / setup (push) Canceled after 0s
Publish build_manylinux_x86_64 images / publish_build_manylinux_x86_64 (push) Canceled after 0s
Setup (Multi-Arch) / setup (push) Canceled after 0s
Multi-Arch CI / Linux::${{ fromJSON(needs.setup.outputs.linux_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubi10 image / publish_no_rocm_image_ubi10 (push) Canceled after 0s
Multi-Arch CI / Windows::${{ fromJSON(needs.setup.outputs.windows_build_config || '{}').build_variant_label || 'skip' }} (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Multi-Arch CI / Manifest Diff (push) Canceled after 0s
TheRock Manifest Diff Report / Generate Manifest Diff Report (push) Canceled after 0s
Multi-Arch CI / CI Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_ocl_rt images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04_rocgdb images / publish_no_rocm_image_ubuntu24_04_rocgdb (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_ocl_rt (push) Canceled after 0s
Publish TheRock Docker image / build-and-push-image (push) Canceled after 0s
Unit Tests / Unit Tests :: ubuntu-24.04 (push) Canceled after 0s
Unit Tests / Unit Tests :: windows-2022 (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_media (push) Canceled after 0s
Unit Tests / Unit Tests Summary (push) Canceled after 0s
Publish no_rocm_image_ubuntu24_04 images / publish_no_rocm_image_ubuntu24_04_openmpi (push) Canceled after 0s
107 lines
3.4 KiB
YAML
107 lines
3.4 KiB
YAML
name: "Code lint"
|
|
|
|
permissions:
|
|
contents: read
|
|
|
|
on:
|
|
pull_request:
|
|
branches:
|
|
- amd-staging
|
|
paths:
|
|
- 'clang-tools-extra/clang-tidy/**'
|
|
- 'clang-tools-extra/docs/clang-tidy/**'
|
|
- '.github/workflows/pr-code-lint.yml'
|
|
|
|
jobs:
|
|
code_linter:
|
|
runs-on: ubuntu-24.04
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
container:
|
|
image: 'ghcr.io/llvm/ci-ubuntu-24.04-lint:latest@sha256:91665a4e158d3b2a4b93da1ebdab3067196a8b48f1f84759cc83c09e9d038ee5'
|
|
timeout-minutes: 60
|
|
concurrency:
|
|
group: ${{ github.workflow }}-${{ github.ref }}
|
|
cancel-in-progress: true
|
|
steps:
|
|
- name: Fetch LLVM sources
|
|
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
|
|
with:
|
|
persist-credentials: false
|
|
fetch-depth: 2
|
|
|
|
- name: Get changed files
|
|
id: changed-files
|
|
uses: tj-actions/changed-files@9426d40962ed5378910ee2e21d5f8c6fcbf2dd96 # v47.0.6
|
|
with:
|
|
separator: ","
|
|
skip_initial_fetch: true
|
|
base_sha: 'HEAD~1'
|
|
sha: 'HEAD'
|
|
|
|
- name: Listed files
|
|
env:
|
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
run: |
|
|
echo "Changed files:"
|
|
echo "$CHANGED_FILES"
|
|
|
|
# TODO: create special mapping for 'codegen' targets, for now build predefined set
|
|
# TODO: add entrypoint in 'compute_projects.py' that only adds a project and its direct dependencies
|
|
- name: Configure and CodeGen
|
|
run: |
|
|
git config --global --add safe.directory '*'
|
|
|
|
. <(git diff --name-only HEAD~1...HEAD | python3 .ci/compute_projects.py)
|
|
|
|
if [[ "${projects_to_build}" == "" ]]; then
|
|
echo "No projects to analyze"
|
|
exit 0
|
|
fi
|
|
|
|
cmake -G Ninja \
|
|
-B build \
|
|
-S llvm \
|
|
-DLLVM_ENABLE_ASSERTIONS=OFF \
|
|
-DLLVM_ENABLE_PROJECTS="${projects_to_build}" \
|
|
-DCMAKE_CXX_COMPILER=clang++ \
|
|
-DCMAKE_C_COMPILER=clang \
|
|
-DCMAKE_EXPORT_COMPILE_COMMANDS=ON \
|
|
-DLLVM_INCLUDE_TESTS=OFF \
|
|
-DCLANG_INCLUDE_TESTS=OFF \
|
|
-DCMAKE_BUILD_TYPE=Release
|
|
|
|
ninja_targets=""
|
|
if [[ ";${projects_to_build};" == *";clang;"* ]]; then
|
|
ninja_targets="${ninja_targets} clang-tablegen-targets"
|
|
fi
|
|
if [[ ";${projects_to_build};" == *";clang-tools-extra;"* ]]; then
|
|
ninja_targets="${ninja_targets} genconfusable"
|
|
fi
|
|
if [[ -n "${ninja_targets}" ]]; then
|
|
ninja -C build ${ninja_targets}
|
|
fi
|
|
|
|
- name: Run code linters
|
|
env:
|
|
GITHUB_PR_NUMBER: ${{ github.event.pull_request.number }}
|
|
CHANGED_FILES: ${{ steps.changed-files.outputs.all_changed_files }}
|
|
run: |
|
|
echo "[]" > comments &&
|
|
python3 llvm/utils/git/code-lint-helper.py \
|
|
--token ${{ secrets.GITHUB_TOKEN }} \
|
|
--issue-number $GITHUB_PR_NUMBER \
|
|
--start-rev HEAD~1 \
|
|
--end-rev HEAD \
|
|
--verbose \
|
|
--changed-files "$CHANGED_FILES"
|
|
|
|
- name: Upload results
|
|
uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
|
|
if: always()
|
|
with:
|
|
name: workflow-args
|
|
path: |
|
|
comments
|