From ab1bf762a69551dc7356cc8f3362df950f0af959 Mon Sep 17 00:00:00 2001 From: Volodymyr Kolesnykov Date: Wed, 5 Feb 2025 09:14:41 +0200 Subject: [PATCH] ci: add clang-tidy workflow --- .github/workflows/clang-tidy.yml | 43 ++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100644 .github/workflows/clang-tidy.yml diff --git a/.github/workflows/clang-tidy.yml b/.github/workflows/clang-tidy.yml new file mode 100644 index 0000000..3121841 --- /dev/null +++ b/.github/workflows/clang-tidy.yml @@ -0,0 +1,43 @@ +name: clang-tidy + +on: + push: + branches: + - master + pull_request: + workflow_dispatch: + +permissions: + contents: read + +jobs: + clang-tidy: + name: Run clang-tidy + runs-on: ubuntu-latest + permissions: + contents: read + steps: + - name: Harden Runner + uses: step-security/harden-runner@cb605e52c26070c328afc4562f0b4ada7618a84e # v2.10.4 + with: + egress-policy: block + allowed-endpoints: > + api.github.com:443 + azure.archive.ubuntu.com:80 + esm.ubuntu.com:443 + github.com:443 + motd.ubuntu.com:443 + objects.githubusercontent.com:443 + packages.microsoft.com:443 + + - name: Check out the source code + uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 + + - name: Install dependencies + uses: ./.github/actions/install-dependencies + + - name: Configure + run: cmake -B build -DCMAKE_EXPORT_COMPILE_COMMANDS=ON + + - name: Run clang-tidy + run: clang-tidy -p build $(jq -r '.[].file' build/compile_commands.json) --warnings-as-errors='*'