Skip to content

Commit 881a1c3

Browse files
committed
Initial commit
0 parents  commit 881a1c3

27 files changed

+3964
-0
lines changed

.clang-format

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
BasedOnStyle: Google
2+
IndentWidth: 4
3+
ColumnLimit: 100

.devcontainer/Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ubuntu:latest
2+
3+
RUN apt-get update && apt-get install -y \
4+
build-essential \
5+
cmake \
6+
git \
7+
clang \
8+
lldb \
9+
gdb \
10+
&& rm -rf /var/lib/apt/lists/*

.devcontainer/devcontainer.json

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
2+
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
3+
{
4+
"name": "C++",
5+
"build": {
6+
"dockerfile": "Dockerfile"
7+
},
8+
9+
// Features to add to the dev container. More info: https://containers.dev/features.
10+
// "features": {},
11+
12+
// Use 'forwardPorts' to make a list of ports inside the container available locally.
13+
// "forwardPorts": [],
14+
15+
// Use 'postCreateCommand' to run commands after the container is created.
16+
// "postCreateCommand": "gcc -v",
17+
18+
// Configure tool-specific properties.
19+
"customizations": {
20+
"vscode": {
21+
"extensions": [
22+
"ms-vscode.cpptools",
23+
"ms-vscode.cmake-tools"
24+
]
25+
}
26+
}
27+
28+
// Uncomment to connect as root instead. More info: https://aka.ms/dev-containers-non-root.
29+
// "remoteUser": "root"
30+
}

.gitattributes

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
* text=auto eol=lf
2+
*.{cmd,[cC][mM][dD]} text eol=crlf
3+
*.{bat,[bB][aA][tT]} text eol=crlf

.github/dependabot.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# To get started with Dependabot version updates, you'll need to specify which
2+
# package ecosystems to update and where the package manifests are located.
3+
# Please see the documentation for more information:
4+
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates
5+
# https://containers.dev/guide/dependabot
6+
7+
version: 2
8+
updates:
9+
- package-ecosystem: "devcontainers"
10+
directory: "/"
11+
schedule:
12+
interval: weekly
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
name: create package
2+
permissions:
3+
contents: write
4+
5+
on:
6+
release:
7+
types: [published]
8+
9+
jobs:
10+
create-package:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: actions/checkout@v4
14+
15+
- name: Create build environment
16+
run: cmake -E make_directory build
17+
18+
- name: Configure CMake
19+
run: cmake -B ./build
20+
21+
- name: Create package
22+
run: cmake --build ./build --target package
23+
24+
- name: Get package name
25+
id: package_name
26+
run: cat ./build/package_name >> "$GITHUB_OUTPUT"
27+
28+
- name: Upload package
29+
uses: svenstaro/upload-release-action@v2
30+
with:
31+
repo_token: ${{ secrets.GITHUB_TOKEN }}
32+
file: build/${{ steps.package_name.outputs.name }}
33+
tag: ${{ github.ref }}

.github/workflows/examples.yml

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
name: examples
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
os:
7+
description: 'Operating system to run the job on (ubuntu-latest, windows-latest, macos-latest)'
8+
required: true
9+
type: string
10+
cxx_compilers:
11+
description: 'List of compilers to use'
12+
required: true
13+
type: string
14+
15+
jobs:
16+
examples:
17+
runs-on: ${{ inputs.os }}
18+
19+
strategy:
20+
fail-fast: true
21+
22+
matrix:
23+
cxx_compiler: ${{ fromJSON(inputs.cxx_compilers) }}
24+
build_type: [Debug, Release]
25+
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v4
29+
30+
- name: Setup build directory
31+
id: strings
32+
shell: bash
33+
run: |
34+
echo "build-output-dir=${{ github.workspace }}/build.examples" >> "$GITHUB_OUTPUT"
35+
36+
- name: Configure CMake
37+
run: >
38+
cmake -B ${{ steps.strings.outputs.build-output-dir }}
39+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx_compiler }}
40+
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
41+
-S ${{ github.workspace }}/examples
42+
43+
- name: Build examples
44+
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config ${{ matrix.build_type }}
45+
46+
- name: Run examples
47+
run: ctest --output-on-failure --build-config ${{ matrix.build_type }} --test-dir ${{ steps.strings.outputs.build-output-dir }}

.github/workflows/lint.yml

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
name: lint
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
lint:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- uses: actions/checkout@v4
15+
16+
- name: Check formatting
17+
run: |
18+
find examples include tests -name '*.cpp' -o -name '*.h' |
19+
xargs clang-format -style=file -i # --dry-run --Werror

.github/workflows/linux.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: linux
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
tests-and-examples:
11+
uses: ./.github/workflows/tests-and-examples.yml
12+
with:
13+
os: 'ubuntu-24.04'
14+
cxx_compilers: '["g++-14", "clang++-17"]'

.github/workflows/macos.yml

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
name: macos
2+
3+
on:
4+
push:
5+
branches: [ "main" ]
6+
pull_request:
7+
branches: [ "main" ]
8+
9+
jobs:
10+
tests-and-examples:
11+
uses: ./.github/workflows/tests-and-examples.yml
12+
with:
13+
os: 'macos-15'
14+
cxx_compilers: '["clang++"]'

0 commit comments

Comments
 (0)