Skip to content

Commit

Permalink
Merge branch 'master' of github.com:motis-project/utl
Browse files Browse the repository at this point in the history
  • Loading branch information
felixguendling committed Sep 12, 2024
2 parents d38b0ea + ad5df9b commit 34de3df
Show file tree
Hide file tree
Showing 13 changed files with 151 additions and 102 deletions.
49 changes: 33 additions & 16 deletions .clang-tidy.in
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
Checks: "*,\
-llvmlibc-*,\
-abseil-*,\
-readability-identifier-length,\
-altera-unroll-loops,\
-altera-id-dependent-backward-branch,\
-bugprone-easily-swappable-parameters,\
-bugprone-implicit-widening-of-multiplication-result,\
-llvm-else-after-return,\
-hicpp-named-parameter,\
-cert-err60-cpp,\
Expand Down Expand Up @@ -44,7 +49,7 @@ Checks: "*,\
-cppcoreguidelines-pro-bounds-constant-array-index,\
-*-avoid-c-arrays,\
-*-narrowing-conversions,\
-*-avoid-goto,
-*-avoid-goto,\
-hicpp-multiway-paths-covered,\
-clang-analyzer-cplusplus.NewDeleteLeaks,\
-clang-analyzer-cplusplus.NewDelete,\
Expand All @@ -62,10 +67,22 @@ Checks: "*,\
-llvm-else-after-return,\
-llvm-qualified-auto,\
-readability-qualified-auto,\
-google-readability-avoid-underscore-in-googletest-name"
-google-readability-avoid-underscore-in-googletest-name,\
-readability-function-cognitive-complexity,\
-readability-avoid-const-params-in-decls,\
-cppcoreguidelines-avoid-const-or-ref-data-members,\
-cppcoreguidelines-avoid-do-while,\
-altera-struct-pack-align,\
-bugprone-unchecked-optional-access,\
-readability-identifier-naming,\
-cert-dcl37-c,\
-bugprone-reserved-identifier,\
-cert-dcl51-cpp,\
-misc-confusable-identifiers"
WarningsAsErrors: '*'
HeaderFilterRegex: '^${RELATIVE_SOURCE_DIR}include/'
AnalyzeTemporaryDtors: false
UseColor: true
User: root
CheckOptions:
- key: cert-err61-cpp.CheckThrowTemporaries
Expand Down Expand Up @@ -336,22 +353,8 @@ CheckOptions:
value: ''
- key: readability-identifier-naming.TemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TemplateParameterSuffix
value: ''
- key: readability-identifier-naming.TemplateTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TemplateTemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TemplateTemplateParameterSuffix
value: ''
- key: readability-identifier-naming.TypeTemplateParameterCase
value: CamelCase
- key: readability-identifier-naming.TypeTemplateParameterPrefix
value: ''
- key: readability-identifier-naming.TypeTemplateParameterSuffix
value: ''
- key: readability-identifier-naming.TypedefCase
value: lower_case
- key: readability-identifier-naming.TypedefPrefix
Expand Down Expand Up @@ -386,3 +389,17 @@ CheckOptions:
value: '0'
- key: readability-simplify-boolean-expr.ChainedConditionalReturn
value: '0'
- key: performance-for-range-copy.AllowedTypes
value: 'offset_ptr;ptr'
- key: performance-unnecessary-value-param.AllowedTypes
value: 'offset_ptr;ptr'
- key: readability-identifier-naming.TypeTemplateParameterIgnoredRegexp
value: 'expr-type'
- key: readability-identifier-naming.TemplateParameterIgnoredRegexp
value: 'expr-type'
- key: readability-identifier-naming.TypeTemplateParameterIgnoredRegexp
value: 'expr-type'
- key: readability-identifier-naming.TemplateTemplateParameterIgnoredRegexp
value: 'expr-type'
- key: readability-identifier-naming.ValueTemplateParameterIgnoredRegexp
value: 'expr-type'
64 changes: 32 additions & 32 deletions .github/workflows/unix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:

jobs:
formatting:
runs-on: ubuntu-20.04
runs-on: ubuntu-24.04
steps:
- uses: actions/checkout@v2

Expand All @@ -18,11 +18,11 @@ jobs:
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo ./llvm.sh 18
rm llvm.sh
sudo apt-get install -y --no-install-recommends clang-format-14
sudo apt-get install -y --no-install-recommends clang-format-18
- name: Format files
run: find test include -type f -not -name catch.hpp -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-14 -i
run: find test include -type f -not -name catch.hpp -a \( -name "*.cc" -o -name "*.h" \) -print0 | xargs -0 clang-format-18 -i

- name: Check for differences
run: |
Expand All @@ -41,43 +41,43 @@ jobs:
mode: Release
cxxflags: -stdlib=libc++
os: macos-latest
- name: GCC 10 Release
cxx: g++-10
cc: gcc-10
- name: GCC 12 Release
cxx: g++-12
cc: gcc-12
mode: Release
os: ubuntu-20.04
- name: GCC 10 Release
cxx: g++-10
cc: gcc-10
os: ubuntu-24.04
- name: GCC 12 Release
cxx: g++-12
cc: gcc-12
mode: Release
os: ubuntu-20.04
- name: GCC 10 Debug
cxx: g++-10
cc: gcc-10
os: ubuntu-24.04
- name: GCC 12 Debug
cxx: g++-12
cc: gcc-12
mode: Debug
os: ubuntu-20.04
- name: Clang 14 Release
cxx: clang++-14
cc: clang-14
os: ubuntu-24.04
- name: Clang 18 Release
cxx: clang++-18
cc: clang-18
mode: Release
cxxflags: -stdlib=libc++
ldflags: -lc++abi
os: ubuntu-20.04
os: ubuntu-24.04
- name: Clang Tidy
cxx: clang++-14
cc: clang-14
cxx: clang++-18
cc: clang-18
mode: Debug
cxxflags: -stdlib=libc++
ldflags: -lc++abi
lint: true
os: ubuntu-20.04
- key: GCC 10 Sanitizer
cxx: g++-10
cc: gcc-10
os: ubuntu-24.04
- key: GCC 12 Sanitizer
cxx: g++-12
cc: gcc-12
mode: Release
cflags: -fsanitize=address,undefined -fno-omit-frame-pointer
cxxflags: -fsanitize=address,undefined -fno-omit-frame-pointer
os: ubuntu-20.04
os: ubuntu-24.04
env:
DEBIAN_FRONTEND: noninteractive
UBSAN_OPTIONS: halt_on_error=1:abort_on_error=1
Expand All @@ -93,16 +93,16 @@ jobs:
run: sudo apt-get update

- name: Install LLVM
if: matrix.config.os != 'macos-latest' && matrix.config.cc == 'clang-14'
if: matrix.config.os != 'macos-latest' && matrix.config.cc == 'clang-18'
run: |
wget https://apt.llvm.org/llvm.sh
chmod +x llvm.sh
sudo ./llvm.sh 14
sudo ./llvm.sh 18
rm llvm.sh
sudo apt-get install -y --no-install-recommends libc++-14-dev libc++abi-14-dev clang-tidy-14 libunwind-14-dev llvm-14
sudo apt-get install -y --no-install-recommends libc++-18-dev libc++abi-18-dev clang-tidy-18 libunwind-18-dev llvm-18
- name: Install Valgrind
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-10'
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-12'
run: sudo apt-get install -y --no-install-recommends valgrind

- name: Install Ninja
Expand Down Expand Up @@ -133,5 +133,5 @@ jobs:

# ==== VALGRIND ====
- name: Run Tests Valgrind
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-10'
if: matrix.config.mode == 'Debug' && matrix.config.cc == 'gcc-12'
run: valgrind --error-exitcode=1 --show-reachable=yes --leak-check=full ./build/utl-test
21 changes: 18 additions & 3 deletions .github/workflows/windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,26 +6,41 @@ on:
pull_request:
branches: [ master ]

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
build:
runs-on: windows-latest

strategy:
fail-fast: false
matrix:
mode: [Debug, Release]
config:
- name: MSVC Debug
mode: Debug
- name: MSVC Release
mode: Release
- name: Clang Debug
mode: Debug
cmake-opt: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl
cc: clang-cl
- name: Clang Release
mode: Release
cmake-opt: -DCMAKE_C_COMPILER=clang-cl -DCMAKE_CXX_COMPILER=clang-cl

steps:
- uses: actions/checkout@v2
- uses: seanmiddleditch/gha-setup-ninja@master

- name: Build
run: |
$env:BOOST_ROOT = $env:BOOST_ROOT_1_72_0
$devShell = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -find **\Microsoft.VisualStudio.DevShell.dll
$installPath = &"${env:ProgramFiles(x86)}\Microsoft Visual Studio\Installer\vswhere.exe" -latest -property installationpath
Import-Module $devShell
Enter-VsDevShell -VsInstallPath $installPath -SkipAutomaticLocation -DevCmdArguments "-arch=amd64"
cmake -GNinja -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.mode }}
cmake -GNinja -S . -B build -DCMAKE_BUILD_TYPE=${{ matrix.config.mode }} ${{ matrix.config.cmake-opt }}
cmake --build build --target utl-test
- name: Run tests
Expand Down
2 changes: 1 addition & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
cmake_minimum_required(VERSION 3.20)
project(utl)
cmake_minimum_required(VERSION 3.16)

option(UTL_LINT "Run clang-tidy with the compiler." OFF)
if(UTL_LINT)
Expand Down
Loading

0 comments on commit 34de3df

Please sign in to comment.