Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions .clang-format
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
---
Language: Cpp
BasedOnStyle: LLVM
IndentWidth: 2
---
Language: Cpp
AccessModifierOffset: -2
AlignAfterOpenBracket: Align
AlignArrayOfStructures: None
Expand Down Expand Up @@ -89,11 +91,11 @@ IfMacros:
- KJ_IF_MAYBE
IncludeBlocks: Preserve
IncludeCategories:
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
- Regex: '^"(beman|llvm|llvm-c|clang|clang-c)/'
Priority: 2
SortPriority: 0
CaseSensitive: false
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
- Regex: '^(<|"(catch2|gtest|gmock|isl|json)/)'
Priority: 3
SortPriority: 0
CaseSensitive: false
Expand Down
28 changes: 14 additions & 14 deletions .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
// For format details, see https://aka.ms/devcontainer.json. For config options, see the
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp
// README at: https://github.com/devcontainers/templates/tree/main/src/cpp

{
"name": "Beman Project Generic Devcontainer",
"image": "ghcr.io/bemanproject/devcontainers-gcc:14",
"postCreateCommand": "pre-commit",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
}
}
{
"name": "Beman Project Generic Devcontainer",
"image": "ghcr.io/bemanproject/devcontainers-gcc:14",
"postCreateCommand": "pre-commit",
"customizations": {
"vscode": {
"extensions": [
"ms-vscode.cpptools",
"ms-vscode.cmake-tools"
]
}
}
}
315 changes: 116 additions & 199 deletions .github/workflows/ci_tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,212 +4,129 @@ name: Continuous Integration Tests

on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "30 15 * * *"
- cron: '30 15 * * *'

jobs:
preset-test:
permissions:
actions: read
strategy:
fail-fast: false
matrix:
presets:
- preset: "gcc-debug"
compiler: "gcc:14"
- preset: "gcc-release"
compiler: "gcc:14"
- preset: "llvm-debug"
compiler: "clang:19"
- preset: "llvm-release"
compiler: "clang:19"
# - preset: "appleclang-debug"
# platform: "macos-latest"
# - preset: "appleclang-release"
# platform: "macos-latest"
- preset: "msvc-debug"
platform: "windows-latest"
- preset: "msvc-release"
platform: "windows-latest"
name: "Preset: ${{ matrix.presets.preset }} on ${{ matrix.presets.platform || matrix.presets.compiler }}"
runs-on: ${{ matrix.presets.platform || 'ubuntu-latest' }}
container:
image: ${{ matrix.presets.compiler && 'ghcr.io/bemanproject/testingcontainers-' }}${{ matrix.presets.compiler }}
steps:
- uses: actions/checkout@v4
- name: Setup Environment
if: ${{ !matrix.presets.compiler }}
uses: ./.github/actions/setup-environment
- name: Get vcpkg deps
shell: bash
if: ${{ !contains(runner.os, 'Windows') }}
run: |
sudo apt-get install -y pkg-config zip
- name: Restore vcpkg cache
id: vcpkg-cache
uses: TAServers/vcpkg-cache@v3
with:
token: ${{ secrets.GITHUB_TOKEN }}
- name: Run preset
env:
VCPKG_BINARY_SOURCES: "clear;files,${{ steps.vcpkg-cache.outputs.path }},readwrite"
run: cmake --workflow --preset ${{ matrix.presets.preset }}

catch-test:
permissions:
actions: read
strategy:
fail-fast: false
matrix:
platform:
- description: "GNU 14"
compiler: "gcc:14"
toolchain: "cmake/gnu-toolchain.cmake"
- description: "LLVM 19"
compiler: "clang:19"
toolchain: "cmake/llvm-toolchain.cmake"
- description: "Windows MSVC"
os: windows-latest
toolchain: "cmake/msvc-toolchain.cmake"
#- description: "Macos Appleclang"
# os: macos-latest
# toolchain: "cmake/appleclang-toolchain.cmake"
cpp_version: [20, 23, 26]
cmake_args:
- description: "Default"
- description: "TSan"
args: "-DBEMAN_BUILDSYS_SANITIZER=TSan"
- description: "MaxSan"
args: "-DBEMAN_BUILDSYS_SANITIZER=MaxSan"
include:
- platform:
description: "GCC 14"
compiler: "gcc:14"
toolchain: "cmake/gnu-toolchain.cmake"
cpp_version: 20
cmake_args:
description: "Werror"
args: "-DCMAKE_CXX_FLAGS='-Werror=all -Werror=extra'"
- platform:
description: "GCC 14"
compiler: "gcc:14"
toolchain: "cmake/gnu-toolchain.cmake"
cpp_version: 20
cmake_args:
description: "Dynamic"
args: "-DBUILD_SHARED_LIBS=on"
exclude:
# MSVC does not support thread sanitizer
- platform:
description: "Windows MSVC"
cmake_args:
description: "TSan"
beman-submodule-check:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-submodule-check.yml@1.1.0

name: "Unit:
${{ matrix.platform.description }}
${{ matrix.cpp_version }}
${{ matrix.cmake_args.description }}"
runs-on: ${{ matrix.platform.os || 'ubuntu-latest' }}
container:
image: ${{ matrix.platform.compiler && 'ghcr.io/bemanproject/testingcontainers-' }}${{ matrix.platform.compiler }}
steps:
- uses: actions/checkout@v4
- name: Setup Environment
if: ${{ !matrix.platform.compiler }}
uses: ./.github/actions/setup-environment
- name: Build and Test
uses: ./.github/actions/cmake-build-test
with:
cpp_version: ${{ matrix.cpp_version }}
toolchain_file: ${{ matrix.platform.toolchain }}
cmake_extra_args: ${{ matrix.cmake_args.args }}

configuration-test:
permissions:
actions: read
runs-on: ubuntu-latest
container:
image: ghcr.io/bemanproject/testingcontainers-gcc:14
strategy:
fail-fast: false
matrix:
args:
- name: "Disable build testing"
arg: "-DBEMAN_BOUNDS_TEST_BUILD_TESTS=OFF"
- name: "Disable example building"
arg: "-DBEMAN_BOUNDS_TEST_BUILD_EXAMPLES=OFF"
- name: "Disable config-file package creation"
arg: "-DBEMAN_BOUNDS_TEST_INSTALL_CONFIG_FILE_PACKAGE=OFF"
name: "CMake: ${{ matrix.args.name }}"
steps:
- uses: actions/checkout@v4
- name: Build and Test
uses: ./.github/actions/cmake-build-test
with:
cpp_version: 20
toolchain_file: "cmake/gnu-toolchain.cmake"
cmake_extra_args: ${{ matrix.args.arg }}
disable_test: true
preset-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-preset-test.yml@1.1.0
with:
matrix_config: >
[
{"preset": "gcc-debug", "image": "ghcr.io/bemanproject/infra-containers-gcc:latest"},
{"preset": "gcc-release", "image": "ghcr.io/bemanproject/infra-containers-gcc:latest"},
{"preset": "llvm-debug", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "llvm-release", "image": "ghcr.io/bemanproject/infra-containers-clang:latest"},
{"preset": "appleclang-debug", "runner": "macos-latest"},
{"preset": "appleclang-release", "runner": "macos-latest"},
{"preset": "msvc-debug", "runner": "windows-latest"},
{"preset": "msvc-release", "runner": "windows-latest"}
]

compiler-test:
permissions:
actions: read
strategy:
fail-fast: false
matrix:
compilers:
- class: gcc
version: 14
toolchain: "cmake/gnu-toolchain.cmake"
- class: clang
version: 20
toolchain: "cmake/llvm-toolchain.cmake"
- class: clang
version: 19
toolchain: "cmake/llvm-toolchain.cmake"
- class: clang
version: 18
toolchain: "cmake/llvm-toolchain.cmake"
- class: clang
version: 17
toolchain: "cmake/llvm-toolchain.cmake"
name: "Compiler: ${{ matrix.compilers.class }} ${{ matrix.compilers.version }}"
runs-on: ubuntu-24.04
container:
image: ghcr.io/bemanproject/testingcontainers-${{ matrix.compilers.class }}:${{ matrix.compilers.version }}
steps:
- uses: actions/checkout@v4
- name: Build and Test
uses: ./.github/actions/cmake-build-test
with:
cpp_version: 20
toolchain_file: ${{ matrix.compilers.toolchain }}
build-and-test:
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-build-and-test.yml@1.1.0
with:
matrix_config: >
{
"gcc": [
{ "versions": ["15"],
"tests": [
{ "cxxversions": ["c++26"],
"tests": [
{ "stdlibs": ["libstdc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror", "Debug.Dynamic",
"Debug.Coverage"
]
}
]
},
{ "cxxversions": ["c++23", "c++20"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
}
]
},
{ "versions": ["14", "13"],
"tests": [
{ "cxxversions": ["c++26", "c++23", "c++20"],
"tests": [{ "stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
}
]
}
],
"clang": [
{ "versions": ["21"],
"tests": [
{"cxxversions": ["c++26"],
"tests": [
{ "stdlibs": ["libstdc++", "libc++"],
"tests": [
"Debug.Default", "Release.Default", "Release.TSan",
"Release.MaxSan", "Debug.Werror", "Debug.Dynamic"
]
}
]
},
{ "cxxversions": ["c++23", "c++20"],
"tests": [
{"stdlibs": ["libstdc++", "libc++"], "tests": ["Release.Default"]}
]
}
]
},
{ "versions": ["20", "19", "18"],
"tests": [
{ "cxxversions": ["c++26", "c++23", "c++20"],
"tests": [
{"stdlibs": ["libstdc++", "libc++"], "tests": ["Release.Default"]}
]
}
]
},
{ "versions": ["17"],
"tests": [
{ "cxxversions": ["c++26", "c++23", "c++20"],
"tests": [{"stdlibs": ["libc++"], "tests": ["Release.Default"]}]
},
{ "cxxversions": ["c++20"],
"tests": [{"stdlibs": ["libstdc++"], "tests": ["Release.Default"]}]
}
]
}
],
"appleclang": [
{ "versions": ["latest"],
"tests": [
{ "cxxversions": ["c++26", "c++23", "c++20"],
"tests": [{ "stdlibs": ["libc++"], "tests": ["Release.Default"]}]
}
]
}
],
"msvc": [
{ "versions": ["latest"],
"tests": [
{ "cxxversions": ["c++23"],
"tests": [
{ "stdlibs": ["stl"],
"tests": ["Debug.Default", "Release.Default", "Release.MaxSan"]
}
]
}
]
}
]
}

create-issue-when-fault:
runs-on: ubuntu-latest
needs: [preset-test, catch-test, configuration-test, compiler-test]
needs: [preset-test, build-and-test]
if: failure() && github.event_name == 'schedule'
steps:
# See https://github.com/cli/cli/issues/5075
- uses: actions/checkout@v4
- name: Create issue
run: |
issue_num=$(gh issue list -s open -S "[SCHEDULED-BUILD] Build & Test failure" -L 1 --json number | jq 'if length == 0 then -1 else .[0].number end')

body="**Build-and-Test Failure Report**
- **Time of Failure**: $(date -u '+%B %d, %Y, %H:%M %Z')
- **Commit**: [${{ github.sha }}](${{ github.server_url }}/${{ github.repository }}/commit/${{ github.sha }})
- **Action Run**: [View logs](${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }})

The scheduled build-and-test triggered by cron has failed.
Please investigate the logs and recent changes associated with this commit or rerun the workflow if you believe this is an error."

if [[ $issue_num -eq -1 ]]; then
gh issue create --repo ${{ github.repository }} --title "[SCHEDULED-BUILD] Build & Test failure" --body "$body"
else
gh issue comment --repo ${{ github.repository }} $issue_num --body "$body"
fi
env:
GH_TOKEN: ${{ github.token }}
uses: bemanproject/infra-workflows/.github/workflows/reusable-beman-create-issue-when-fault.yml@1.1.0
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

# Miscellaneous build and testing folders
build/
compile_commands.json

# Loose files
.DS_Store
Loading