Skip to content

Commit

Permalink
Our clang-tidy setup requires >= v17
Browse files Browse the repository at this point in the history
- "tools/run_tidy.sh" now checks clang-tidy version number and fails if < v17
- gha workflow "clang-tidy-check.yml" now runs on ubuntu-24.04 that should have clang v18
  • Loading branch information
dschlaep committed Aug 1, 2024
1 parent 15dbb06 commit 6273edc
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/clang-tidy-check.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,8 @@
name: clang-tidy check

# ubuntu-24.04 comes with clang v18 as default
# ubuntu-latest as of 2024-Aug-01 points to ubuntu-22.04 with clang v14

on:
push:
branches: [master, main, release/**]
Expand All @@ -9,13 +12,13 @@ on:
jobs:
formatting-check:
name: Tidy Check
runs-on: ubuntu-latest
runs-on: ubuntu-24.04

steps:
- name: Checkout repository and submodules
uses: actions/checkout@v4
with:
submodules: recursive

- name: Run
run: ./tools/run_tidy.sh
10 changes: 10 additions & 0 deletions tools/run_tidy.sh
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,16 @@ if ! command -v clang-tidy > /dev/null 2>&1; then
exit 1
fi

# Verify that clang-tidy is at least v17
ctv=$(clang-tidy --version | egrep -o "version [0-9]+.[0-9]+.[0-9]+")
p1=$(echo "$ctv" | egrep -o "[0-9]+.[0-9]+.[0-9]+" | cut -d "." -f 1)

if [ ! "$p1" -ge 17 ]; then
echo "We require clang-tidy version 17 or later but found" "${ctv}"
exit 1
fi


#-------------------------------------------------------------------------------
process_clangtidy_results() {
local status="$1"
Expand Down

0 comments on commit 6273edc

Please sign in to comment.