Skip to content

Commit

Permalink
wip clang-tidy
Browse files Browse the repository at this point in the history
  • Loading branch information
joto committed Jun 14, 2024
1 parent 43ec304 commit e00d208
Show file tree
Hide file tree
Showing 3 changed files with 66 additions and 0 deletions.
9 changes: 9 additions & 0 deletions .github/actions/clang-tidy/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
name: Run clang-tidy

runs:
using: composite

steps:
- name: Run clang-tidy
run: run-clang-tidy-18 -q -p build
shell: bash
33 changes: 33 additions & 0 deletions .github/actions/linux-cmake/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: CMake

runs:
using: composite

steps:
- name: create build directory
run: mkdir build
shell: bash

- name: configure
run: |
CMAKE_OPTIONS="-LA -DBUILD_TESTS=ON"
if [ -z "${LUA_VERSION}" ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DWITH_LUA=OFF"
else
CMAKE_OPTIONS="$CMAKE_OPTIONS -DWITH_LUAJIT=${LUAJIT_OPTION}"
fi
if [ -n "$WITH_PROJ" ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DWITH_PROJ=$WITH_PROJ"
fi
if [ -n "$CPP_VERSION" ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_CXX_STANDARD=$CPP_VERSION"
fi
if [ -n "$BUILD_TYPE" ]; then
CMAKE_OPTIONS="$CMAKE_OPTIONS -DCMAKE_BUILD_TYPE=$BUILD_TYPE"
fi
cmake $CMAKE_OPTIONS ..
shell: bash
working-directory: build
env:
CXXFLAGS: -pedantic -Wextra ${{ env.EXTRA_FLAGS }} -Werror

24 changes: 24 additions & 0 deletions .github/workflows/clang-tidy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: clang-tidy

on: [ push, pull_request ]

jobs:
ubuntu24:
runs-on: ubuntu-24.04

env:
CC: clang-18
CXX: clang++-18
LUA_VERSION: 5.4
LUAJIT_OPTION: OFF
POSTGRESQL_VERSION: 16
POSTGIS_VERSION: 3
BUILD_TYPE: Debug
PSYCOPG: 3
PIP_OPTION: --break-system-packages

steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/linux-cmake
- uses: ./.github/actions/clang-tidy

0 comments on commit e00d208

Please sign in to comment.