Skip to content
This repository has been archived by the owner on Dec 20, 2023. It is now read-only.

Commit

Permalink
⚗️ try newer cpp-linter config
Browse files Browse the repository at this point in the history
  • Loading branch information
burgholzer committed Jun 9, 2023
1 parent 37592a6 commit f8e3dec
Showing 1 changed file with 34 additions and 11 deletions.
45 changes: 34 additions & 11 deletions .github/workflows/cpp-linter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: cpp-linter

on:
pull_request:
merge_group:
push:
branches:
- main
Expand All @@ -12,28 +11,52 @@ concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true

env:
clang-version: 16

jobs:
cpp-linter:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install clang-${{ env.clang-version }}
run: |
sudo apt-get update
wget https://apt.llvm.org/llvm.sh -O ${{ runner.temp }}/llvm_install.sh
chmod +x ${{ runner.temp }}/llvm_install.sh
if sudo ${{ runner.temp }}/llvm_install.sh ${{ env.clang-version }}; then
sudo apt-get install -y clang-format-${{ env.clang-version }} clang-tidy-${{ env.clang-version }}
fi
echo "CC=clang-${{ env.clang-version }}" >> $GITHUB_ENV
echo "CXX=clang++-${{ env.clang-version }}" >> $GITHUB_ENV
- name: Generate compilation database
run: CC=clang-14 CXX=clang++-14 cmake -S . -B build -DBUILD_DD_EVAL_TESTS=ON
run: |
echo $CC
echo $CXX
$CC --version
$CXX --version
cmake -S . -B build -DBUILD_DD_EVAL_TESTS=ON
- name: Run cpp-linter
uses: cpp-linter/cpp-linter-action@v2
id: linter
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
pipx run cpp-linter \
--version=14 \
--style="" \
--tidy-checks="" \
--thread-comments=true \
--files-changed-only=true \
--ignore="build" \
--database=build
with:
style: ""
tidy-checks: ""
version: 16
ignore: build
thread-comments: true
step-summary: true
database: "build"
extra-args: -std=c++17
files-changed-only: true

- name: Fail if linter found errors
if: steps.linter.outputs.checks-failed > 0
run: echo "Linter found errors" && exit 1

0 comments on commit f8e3dec

Please sign in to comment.