Skip to content

Commit

Permalink
Initial version (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
SebastianBach authored May 30, 2024
1 parent be92c06 commit da497df
Show file tree
Hide file tree
Showing 19 changed files with 806 additions and 0 deletions.
42 changes: 42 additions & 0 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
Language: Cpp


ColumnLimit: 80
TabWidth: 4
IndentWidth: 4
UseTab: Never

SortIncludes: true

AccessModifierOffset: -4
MaxEmptyLinesToKeep: 1
AlignConsecutiveAssignments: true
AlignConsecutiveDeclarations: true

BreakBeforeBraces: Allman
BraceWrapping:
AfterClass: false
AfterControlStatement: true
AfterEnum: true
AfterFunction: true
AfterNamespace: true
AfterObjCDeclaration: true
AfterStruct: true
AfterUnion: true
AfterExternBlock: true
BeforeCatch: true
BeforeElse: true
IndentBraces: true

AllowShortFunctionsOnASingleLine: Empty

SpacesInAngles: false
SpacesInContainerLiterals: true
SpacesInCStyleCastParentheses: false
SpacesInParentheses: false
SpacesInSquareBrackets: false

SpaceBeforeAssignmentOperators: true
SpaceBeforeParens: ControlStatements

PointerAlignment: Left
10 changes: 10 additions & 0 deletions .clang-tidy
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
Checks: >
readability-magic-numbers,
performance-unnecessary-value-param
CheckOptions:
- key: readability-type-name.MinTypeNameLength
value: 1

WarningsAsErrors: '*'

175 changes: 175 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,175 @@
name: build jobs

on: [push]

jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DCMAKE_BUILD_TYPE=Release ..
working-directory: ./build

- name: build
run: cmake --build . -j
working-directory: ./build

- name: tests
run: ctest --output-junit test_results.xml
working-directory: ./build

build_with_warnings:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_WARNINGS=ON ..
working-directory: ./build

- name: build
run: cmake --build . -j
working-directory: ./build

run_cppcheck:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DCMAKE_BUILD_TYPE=Release -DCMAKE_EXPORT_COMPILE_COMMANDS=ON ..
working-directory: ./build

- name: cppcheck
run: cppcheck --project=compile_commands.json --cppcheck-build-dir=./temp/cppcheck --error-exitcode=1 --enable=all
working-directory: ./build

run_clang_format:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: clang-format
run: clang-format --dry-run -Werror --style=file src/bad_code.cpp

run_clang_tidy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DENABLE_CLANG_TIDY=ON ..
working-directory: ./build

- name: build
run: cmake --build .
working-directory: ./build

build_asan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_ASAN=ON ..
working-directory: ./build

- name: build
run: cmake --build . -j
working-directory: ./build

- name: tests
run: ctest --output-on-failure
working-directory: ./build


build_ubsan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DCMAKE_BUILD_TYPE=Debug -DENABLE_UBSAN=ON ..
working-directory: ./build

- name: build
run: cmake --build . -j
working-directory: ./build

- name: tests
run: ctest --output-on-failure
working-directory: ./build


run_valgrind:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
name: Check out the repository code

- name: dependencies
run: sudo apt-get install build-essential cmake cppcheck clang-format clang-tidy valgrind

- name: build directory
run: mkdir build

- name: CMake
run: cmake -DUSE_VALGRIND=ON ..
working-directory: ./build

- name: build
run: cmake --build .
working-directory: ./build

- name: tests
run: ctest -T memcheck --output-on-failure
working-directory: ./build

Loading

0 comments on commit da497df

Please sign in to comment.