Skip to content

Commit a96ecb4

Browse files
committed
Initial commit
0 parents  commit a96ecb4

11 files changed

Lines changed: 1273 additions & 0 deletions

File tree

.clang-tidy

Lines changed: 172 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,172 @@
1+
Checks: >
2+
-*,
3+
clang-diagnostic-*,
4+
clang-analyzer-*,
5+
boost-*,
6+
bugprone-argument-comment,
7+
bugprone-assert-side-effect,
8+
bugprone-bad-signal-to-kill-thread,
9+
bugprone-bool-pointer-implicit-conversion,
10+
bugprone-branch-clone,
11+
bugprone-copy-constructor-init,
12+
bugprone-dangling-handle,
13+
bugprone-dynamic-static-initializers,
14+
bugprone-exception-escape,
15+
bugprone-fold-init-type,
16+
bugprone-forward-declaration-namespace,
17+
bugprone-forwarding-reference-overload,
18+
bugprone-inaccurate-erase,
19+
bugprone-incorrect-roundings,
20+
bugprone-infinite-loop,
21+
bugprone-integer-division,
22+
bugprone-lambda-function-name,
23+
bugprone-macro-*,
24+
bugprone-misplaced-*,
25+
bugprone-move-forwarding-reference,
26+
bugprone-multiple-statement-macro,
27+
bugprone-narrowing-conversions,
28+
bugprone-no-escape,
29+
bugprone-not-null-terminated-result,
30+
bugprone-parent-virtual-call,
31+
bugprone-posix-return,
32+
bugprone-redundant-branch-condition,
33+
bugprone-reserved-identifier,
34+
bugprone-signal-handler,
35+
bugprone-signed-char-misuse,
36+
bugprone-sizeof-*,
37+
bugprone-spuriously-wake-up-functions,
38+
bugprone-string-*,
39+
bugprone-suspicious-*,
40+
bugprone-swapped-arguments,
41+
bugprone-terminating-continue,
42+
bugprone-throw-keyword-missing,
43+
bugprone-too-small-loop-variable,
44+
bugprone-undefined-memory-manipulation,
45+
bugprone-undelegated-constructor,
46+
bugprone-unhandled-*,
47+
bugprone-unused-*,
48+
bugprone-use-after-move,
49+
bugprone-virtual-near-miss,
50+
clang-*,
51+
concurrency-*,
52+
cppcoreguidelines-narrowing-conversions,
53+
cppcoreguidelines-pro-type-member-init,
54+
cppcoreguidelines-slicing,
55+
google-default-arguments,
56+
google-explicit-constructor,
57+
google-global-names-in-headers,
58+
google-objc-*,
59+
google-readability-avoid-underscore-in-googletest-name,
60+
google-runtime-operator,
61+
google-upgrade-googletest-case,
62+
hicpp-static-assert,
63+
hicpp-undelegated-constructor,
64+
hicpp-use-emplace,
65+
hicpp-use-equals-*,
66+
hicpp-use-noexcept,
67+
hicpp-use-nullptr,
68+
hicpp-use-override,
69+
llvm-namespace-comment,
70+
misc-definitions-in-headers,
71+
misc-misplaced-const,
72+
misc-new-delete-overloads,
73+
misc-no-recursion,
74+
misc-non-copyable-objects,
75+
misc-redundant-expression,
76+
misc-static-assert,
77+
misc-throw-by-value-catch-by-reference,
78+
misc-unconventional-assign-operator,
79+
misc-uniqueptr-reset-release,
80+
misc-unused-parameters,
81+
misc-unused-using-decls,
82+
modernize-avoid-bind,
83+
modernize-concat-nested-namespaces,
84+
modernize-deprecated-ios-base-aliases,
85+
modernize-loop-convert,
86+
modernize-make-*,
87+
modernize-pass-by-value,
88+
modernize-raw-string-literal,
89+
modernize-redundant-void-arg,
90+
modernize-shrink-to-fit,
91+
modernize-unary-static-assert,
92+
modernize-use-bool-literals,
93+
modernize-use-default-member-init,
94+
modernize-use-emplace,
95+
modernize-use-equals-*,
96+
modernize-use-noexcept,
97+
modernize-use-nullptr,
98+
modernize-use-override,
99+
modernize-use-transparent-functors,
100+
modernize-use-uncaught-exceptions,
101+
performance-*,
102+
portability-*,
103+
readability-avoid-const-params-in-decls,
104+
readability-const-return-type,
105+
readability-container-size-empty,
106+
readability-convert-member-functions-to-static,
107+
readability-delete-null-pointer,
108+
readability-else-after-return,
109+
readability-function-*,
110+
-readability-function-size,
111+
readability-identifier-naming,
112+
readability-inconsistent-declaration-parameter-name,
113+
readability-make-member-function-const,
114+
readability-misleading-indentation,
115+
readability-misplaced-array-index,
116+
readability-non-const-parameter,
117+
readability-qualified-auto,
118+
readability-redundant-control-flow,
119+
readability-redundant-declaration,
120+
readability-redundant-function-ptr-dereference,
121+
readability-redundant-member-init,
122+
readability-redundant-preprocessor,
123+
readability-redundant-smartptr-get,
124+
readability-redundant-string-*,
125+
readability-simplify-*,
126+
readability-static-*,
127+
readability-string-compare,
128+
readability-suspicious-call-argument,
129+
readability-uniqueptr-delete-release,
130+
readability-use-anyofallof,
131+
zircon-*
132+
CheckOptions:
133+
- key: llvm-else-after-return.WarnOnConditionVariables
134+
value: 'false'
135+
- key: modernize-loop-convert.MinConfidence
136+
value: reasonable
137+
- key: modernize-loop-convert.MaxCopySize
138+
value: '16'
139+
- key: modernize-loop-convert.NamingStyle
140+
value: CamelCase
141+
- key: modernize-use-override.IgnoreDestructors
142+
value: 'true'
143+
- key: modernize-replace-auto-ptr.IncludeStyle
144+
value: llvm
145+
- key: cert-str34-c.DiagnoseSignedUnsignedCharComparisons
146+
value: 'false'
147+
- key: google-readability-namespace-comments.ShortNamespaceLines
148+
value: '10'
149+
- key: cert-oop54-cpp.WarnOnlyIfThisHasSuspiciousField
150+
value: 'false'
151+
- key: cppcoreguidelines-non-private-member-variables-in-classes.IgnoreClassesWithAllMemberVariablesBeingPublic
152+
value: 'true'
153+
- key: cert-dcl16-c.NewSuffixes
154+
value: 'L;LL;LU;LLU'
155+
- key: google-readability-braces-around-statements.ShortStatementLines
156+
value: '1'
157+
- key: modernize-pass-by-value.IncludeStyle
158+
value: llvm
159+
- key: google-readability-namespace-comments.SpacesBeforeComments
160+
value: '2'
161+
- key: cppcoreguidelines-explicit-virtual-functions.IgnoreDestructors
162+
value: 'true'
163+
- key: modernize-use-nullptr.NullMacros
164+
value: 'NULL'
165+
- key: llvm-qualified-auto.AddConstToQualified
166+
value: 'false'
167+
- key: llvm-else-after-return.WarnOnUnfixable
168+
value: 'false'
169+
- key: readability-function-cognitive-complexity.IgnoreMacros
170+
value: 'true'
171+
- key: bugprone-signed-char-misuse.CharTypdefsToIgnore
172+
value: 'int8_t;std::int8_t'

.github/workflows/ci.yml

Lines changed: 138 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,138 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: [main]
6+
pull_request:
7+
branches: [main]
8+
9+
# Cancel redundant runs on the same ref (e.g. rapid pushes to a PR branch)
10+
concurrency:
11+
group: ${{ github.workflow }}-${{ github.ref }}
12+
cancel-in-progress: true
13+
14+
permissions:
15+
contents: read
16+
17+
jobs:
18+
build-linux:
19+
runs-on: ${{ matrix.os }}
20+
strategy:
21+
fail-fast: true
22+
matrix:
23+
include:
24+
- { os: ubuntu-24.04, compiler: g++-13, packages: g++-13, build_type: Debug }
25+
- { os: ubuntu-24.04, compiler: g++-14, packages: g++-14, build_type: Release }
26+
- { os: ubuntu-24.04, compiler: clang++-19, packages: clang-19, build_type: Debug }
27+
- { os: ubuntu-24.04, compiler: clang++-20, packages: clang-20, build_type: Release }
28+
- { os: ubuntu-22.04, compiler: g++-12, packages: g++-12, build_type: Debug }
29+
- { os: ubuntu-24.04-arm, compiler: g++-14, packages: g++-14, build_type: Debug }
30+
31+
steps:
32+
- uses: actions/checkout@v6
33+
34+
- name: Install compiler
35+
run: |
36+
sudo apt-get update -q
37+
sudo apt-get install -y ${{ matrix.packages }}
38+
39+
# Cache CPM-downloaded sources keyed on CMakeLists.txt content.
40+
- name: Cache CPM sources
41+
uses: actions/cache@v5
42+
with:
43+
path: ${{ runner.temp }}/cpm-cache
44+
key: cpm-${{ runner.os }}-${{ hashFiles('CMakeLists.txt') }}
45+
restore-keys: cpm-${{ runner.os }}-
46+
47+
- name: Set up ccache
48+
uses: hendrikmuhs/ccache-action@v1.2.21
49+
with:
50+
key: ${{ matrix.os }}-${{ matrix.compiler }}-${{ matrix.build_type }}
51+
52+
- name: Configure, build, and test
53+
env:
54+
CPM_SOURCE_CACHE: ${{ runner.temp }}/cpm-cache
55+
run: |
56+
cmake -B build \
57+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
58+
-DCMAKE_CXX_COMPILER=${{ matrix.compiler }} \
59+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
60+
cmake --build build --parallel
61+
ctest --test-dir build --output-on-failure
62+
63+
build-windows:
64+
needs: build-linux
65+
runs-on: ${{ matrix.os }}
66+
strategy:
67+
fail-fast: true
68+
matrix:
69+
include:
70+
- { os: windows-2025, arch: x64, build_type: Release }
71+
- { os: windows-2022, arch: x64, build_type: Release }
72+
73+
steps:
74+
- uses: actions/checkout@v6
75+
76+
- name: Cache CPM sources
77+
uses: actions/cache@v5
78+
with:
79+
path: ${{ runner.temp }}/cpm-cache
80+
key: cpm-${{ runner.os }}-${{ matrix.arch }}-${{ hashFiles('CMakeLists.txt') }}
81+
restore-keys: cpm-${{ runner.os }}-${{ matrix.arch }}-
82+
83+
- name: Set up sccache
84+
uses: hendrikmuhs/ccache-action@v1.2.21
85+
with:
86+
key: windows-${{ matrix.arch }}-${{ matrix.build_type }}
87+
variant: sccache
88+
89+
- name: Set up MSVC
90+
uses: TheMrMilchmann/setup-msvc-dev@v3
91+
with:
92+
arch: ${{ matrix.arch }}
93+
94+
- name: Configure, build, and test
95+
env:
96+
CPM_SOURCE_CACHE: ${{ runner.temp }}/cpm-cache
97+
run: |
98+
cmake -B build -G Ninja `
99+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} `
100+
-DCMAKE_CXX_COMPILER_LAUNCHER=sccache
101+
cmake --build build --parallel
102+
ctest --test-dir build --output-on-failure
103+
104+
build-macos:
105+
needs: build-windows
106+
runs-on: ${{ matrix.os }}
107+
strategy:
108+
fail-fast: true
109+
max-parallel: 1
110+
matrix:
111+
include:
112+
- { os: macos-14, build_type: Release }
113+
- { os: macos-15, build_type: Release }
114+
115+
steps:
116+
- uses: actions/checkout@v6
117+
118+
- name: Cache CPM sources
119+
uses: actions/cache@v5
120+
with:
121+
path: ${{ runner.temp }}/cpm-cache
122+
key: cpm-${{ runner.os }}-${{ matrix.os }}-${{ hashFiles('CMakeLists.txt') }}
123+
restore-keys: cpm-${{ runner.os }}-${{ matrix.os }}-
124+
125+
- name: Set up ccache
126+
uses: hendrikmuhs/ccache-action@v1.2.21
127+
with:
128+
key: ${{ matrix.os }}-${{ matrix.build_type }}
129+
130+
- name: Configure, build, and test
131+
env:
132+
CPM_SOURCE_CACHE: ${{ runner.temp }}/cpm-cache
133+
run: |
134+
cmake -B build \
135+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }} \
136+
-DCMAKE_CXX_COMPILER_LAUNCHER=ccache
137+
cmake --build build --parallel 1
138+
ctest --test-dir build --output-on-failure

.pre-commit-config.yaml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
repos:
2+
- repo: https://github.com/pre-commit/pre-commit-hooks
3+
rev: v6.0.0
4+
hooks:
5+
- id: check-yaml
6+
- id: end-of-file-fixer
7+
- id: trailing-whitespace
8+
- id: check-shebang-scripts-are-executable
9+
- id: mixed-line-ending
10+
args: [--fix=auto]
11+
12+
13+
- repo: https://github.com/pre-commit/mirrors-clang-format
14+
rev: v21.1.8
15+
hooks:
16+
- id: clang-format
17+
types_or: [c++, c, cuda]
18+
19+
- repo: https://github.com/python-jsonschema/check-jsonschema
20+
rev: 0.36.2
21+
hooks:
22+
- id: check-github-workflows
23+
args: ["--verbose"]

0 commit comments

Comments
 (0)