[CQT-190] [Infra] Add clang-tidy #21
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Linters | |
on: | |
push: | |
branches: | |
- develop | |
pull_request: | |
branches: | |
- develop | |
jobs: | |
cpp-linters: | |
name: "C++ linters" | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Install node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 16.20.2 | |
- name: Install conan | |
run: | | |
pipx install conan | |
shell: bash | |
- name: Get latest CMake | |
uses: lukka/get-cmake@latest | |
# We clean the Conan cache as a preventive measure for our runs in self-hosted runners | |
# Self-hosted runners use containers that cache Conan packages from previous runs, | |
# and that can cause different type of problems | |
- name: Configure and build TS tests (clang/emscripten/wasm) | |
run: | | |
conan profile detect --force | |
conan remove -c "*/*" | |
conan build . -pr=conan/profiles/release-clang-emscripten-wasm -pr:b=conan/profiles/release -b missing | |
shell: bash | |
- name: Run C++ linters | |
uses: cpp-linter/cpp-linter-action@v2 | |
id: linter | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
with: | |
database: '${{ github.workspace }}/build/Release' | |
extensions: 'cpp,hpp' | |
style: 'file' # use .clang-format config file | |
tidy-checks: '' # use .clang-tidy config file | |
version: 18 | |
- name: Fail fast | |
if: steps.linter.outputs.checks-failed > 0 | |
run: | | |
echo "::notice::Try executing 'python3 ./scripts/run_cpp_linters.py .' to fix linter issues." | |
exit 1 |