From b4c591882b62b315a063e66a05ec2688eb29f5f6 Mon Sep 17 00:00:00 2001 From: Giorgis Georgakoudis Date: Fri, 17 Jan 2025 21:43:40 -0800 Subject: [PATCH] Update cpp-linter workflow to reduce volume --- .github/workflows/cpp-linter.yml | 28 ++++++++++++++++++++++++++-- 1 file changed, 26 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml index 1fe8c8b4..873fa4ab 100644 --- a/.github/workflows/cpp-linter.yml +++ b/.github/workflows/cpp-linter.yml @@ -7,13 +7,34 @@ jobs: cpp-linter: runs-on: ubuntu-latest permissions: - contents: read + contents: write pull-requests: write defaults: run: shell: bash -el {0} steps: - uses: actions/checkout@v4 + - name: Setup conda + uses: conda-incubator/setup-miniconda@v3 + with: + conda-remove-defaults: true + # Install Clang/LLVM using conda + - name: Create environment + run: | + conda install -y -q -c conda-forge \ + clang=18.1.3 \ + clangxx=18.1.3 \ + llvmdev=18.1.3 \ + lit=18.1.3 + ln -s ${CONDA_PREFIX}/libexec/llvm/FileCheck ${CONDA_PREFIX}/bin + - name: Run cmake to export compilation database + run: | + mkdir -p build + pushd build + cmake .. \ + -DCMAKE_C_COMPILER=clang \ + -DCMAKE_CXX_COMPILER=clang++ \ + -DCMAKE_EXPORT_COMPILE_COMMANDS=on - uses: cpp-linter/cpp-linter-action@v2 id: linter continue-on-error: true @@ -22,12 +43,15 @@ jobs: with: version: 18 ignore: .github | tests | scripts + database: build + extra-args: '-DENABLE_HIP' style: file tidy-checks: '' lines-changed-only: true format-review: true - tidy-review: true + tidy-review: false passive-reviews: true + thread-comments: true - name: Check clang-format linter status if: steps.linter.outputs.clang-format-checks-failed != 0 run: exit 1