From f5e620b9f9619160005d79582cb8126dd535f1f0 Mon Sep 17 00:00:00 2001 From: Dominic Hamon Date: Mon, 10 Feb 2025 16:15:33 -0800 Subject: [PATCH] let's try an all-in-one solution --- .github/workflows/clang-format-lint.yml | 18 ------------ .github/workflows/clang-tidy.yml | 38 ------------------------- .github/workflows/cpp-linter.yml | 26 +++++++++++++++++ 3 files changed, 26 insertions(+), 56 deletions(-) delete mode 100644 .github/workflows/clang-format-lint.yml delete mode 100644 .github/workflows/clang-tidy.yml create mode 100644 .github/workflows/cpp-linter.yml diff --git a/.github/workflows/clang-format-lint.yml b/.github/workflows/clang-format-lint.yml deleted file mode 100644 index 8f089dc8dc..0000000000 --- a/.github/workflows/clang-format-lint.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: clang-format-lint -on: - push: {} - pull_request: {} - -jobs: - job: - name: check-clang-format - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v4 - - uses: DoozyX/clang-format-lint-action@v0.15 - with: - source: './include/benchmark ./src ./test' - extensions: 'h,cc' - clangFormatVersion: 12 - style: Google diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml deleted file mode 100644 index 558375e3ae..0000000000 --- a/.github/workflows/clang-tidy.yml +++ /dev/null @@ -1,38 +0,0 @@ -name: clang-tidy - -on: - push: {} - pull_request: {} - -jobs: - job: - name: run-clang-tidy - runs-on: ubuntu-latest - strategy: - fail-fast: false - steps: - - uses: actions/checkout@v4 - - - name: install clang-tidy - run: sudo apt update && sudo apt -y install clang-tidy - - - name: create build environment - run: cmake -E make_directory ${{ runner.workspace }}/_build - - - name: configure cmake - shell: bash - working-directory: ${{ runner.workspace }}/_build - run: > - cmake $GITHUB_WORKSPACE - -DBENCHMARK_ENABLE_ASSEMBLY_TESTS=OFF - -DBENCHMARK_ENABLE_LIBPFM=OFF - -DBENCHMARK_DOWNLOAD_DEPENDENCIES=ON - -DCMAKE_C_COMPILER=clang - -DCMAKE_CXX_COMPILER=clang++ - -DCMAKE_EXPORT_COMPILE_COMMANDS=ON - -DGTEST_COMPILE_COMMANDS=OFF - - - name: run - shell: bash - working-directory: ${{ runner.workspace }}/_build - run: run-clang-tidy diff --git a/.github/workflows/cpp-linter.yml b/.github/workflows/cpp-linter.yml new file mode 100644 index 0000000000..b823f0f8c8 --- /dev/null +++ b/.github/workflows/cpp-linter.yml @@ -0,0 +1,26 @@ +name: cpp-linter + +on: + push: {} + pull_request: {} + +jobs: + job: + name: run-clang-tidy + runs-on: ubuntu-latest + strategy: + fail-fast: false + steps: + - uses: actions/checkout@v4 + - uses: cpp-linter/cpp-linter-action@v2 + id: linter + with: + style: 'file' + tidy-checks: '' + extensions: 'c,h,cc' + - name: fail fast format + if: steps.linter.outputs.checks-failed > 0 + run: exit 1 + - name: fail fast tidy + if: steps.linter.outputs.clang-tidy-checks-failed > 0 + run: exit 1