Skip to content
Merged
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
106 changes: 106 additions & 0 deletions .github/workflows/tests.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,106 @@
name: Tests

on: [push, pull_request]

jobs:
test:
name: ${{ matrix.name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- name: Linux x86_64
os: ubuntu-latest
preset: linux-static-dev

- name: Linux aarch64
os: ubuntu-24.04-arm
preset: arm64-linux-static-dev

- name: Linux x86
os: ubuntu-latest
preset: x86-linux-static-dev
apt-extra: gcc-multilib g++-multilib

- name: macOS arm64
os: macos-26
preset: arm64-osx-static-dev

- name: Windows x86_64
os: windows-latest
preset: win-static-dev
msvc-arch: amd64

- name: Windows arm64
os: [windows-11-arm]
preset: arm64-win-static-dev
msvc-arch: arm64

steps:
- name: Checkout
uses: actions/checkout@v7
with:
# Initialise submodules manually so we can rewrite SSH URLs to
# HTTPS first — the .gitmodules file uses git@ URLs which require
# an SSH key that is not available on hosted runners.
submodules: false

- name: Use HTTPS for submodule URLs
run: git config --global url."https://github.com/".insteadOf "git@github.com:"

- name: Initialise submodules
run: git submodule update --init --recursive

- name: Install dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update -q
sudo apt-get install -y ninja-build ${{ matrix.apt-extra }}

- name: Install dependencies (macOS)
if: runner.os == 'macOS'
run: brew install ninja

# Exposes cl.exe, link.exe and ninja to subsequent steps.
# arch must match the target: arm64 selects the native ARM64 toolchain
# (no cross-compilation); amd64 selects the standard x64 toolchain.
- name: Set up MSVC environment
if: runner.os == 'Windows'
uses: ilammy/msvc-dev-cmd@v1
with:
arch: ${{ matrix.msvc-arch }}

- name: Bootstrap vcpkg (Unix)
if: runner.os != 'Windows'
run: ./externals/vcpkg/bootstrap-vcpkg.sh -disableMetrics

- name: Bootstrap vcpkg (Windows)
if: runner.os == 'Windows'
shell: cmd
run: .\externals\vcpkg\bootstrap-vcpkg.bat -disableMetrics

# Cache the installed packages so re-runs don't rebuild everything from
# source. The key covers the triplet (via preset name), the dependency
# manifest and any custom triplet files.
- name: Cache vcpkg packages
uses: actions/cache@v5
with:
path: build/vcpkg_installed
key: vcpkg-${{ matrix.preset }}-${{ hashFiles('vcpkg.json', 'vcpkg_triplets/**') }}
restore-keys: vcpkg-${{ matrix.preset }}-

# clang-tidy is not installed on hosted runners; disable it so the
# build preset's CMAKE_CXX_CLANG_TIDY setting does not break configure.
- name: Configure
run: cmake --preset ${{ matrix.preset }} -DCMAKE_CXX_CLANG_TIDY=

- name: Build
run: cmake --build --preset ${{ matrix.preset }}

# Catch2WithMain makes the executable its own test runner; invoke it
# directly. shell: bash is used on all platforms so the path syntax is
# consistent (Git Bash on Windows resolves Test → Test.exe automatically).
- name: Test
shell: bash
run: ./build/test/Test
3 changes: 3 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
[submodule "externals/vcpkg"]
path = externals/vcpkg
url = git@github.com:microsoft/vcpkg.git
189 changes: 189 additions & 0 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,195 @@
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "arm64-linux-static",
"inherits": [
"base-default",
"base-linux-arm64",
"project-base",
"build-type-release"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "arm64-linux-static"
}
}
},
{
"name": "arm64-linux-static-dev",
"inherits": [
"base-default",
"base-linux-arm64",
"base-dev",
"build-type-debug"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Linux"
},
"cacheVariables": {
"VCPKG_TARGET_TRIPLET": {
"type": "STRING",
"value": "arm64-linux-static"
}
}
},
{
"name": "arm64-osx-static",
"inherits": [
"base-default",
"base-osx-arm64",
"project-base",
"build-type-release"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "arm64-osx-static-dev",
"inherits": [
"base-default",
"base-osx-arm64",
"base-dev",
"build-type-debug"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Darwin"
}
},
{
"name": "arm64-win-static",
"inherits": [
"base-default",
"base-win-arm64",
"project-base",
"build-type-release"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
},
{
"name": "arm64-win-static-dev",
"inherits": [
"base-default",
"base-win-arm64",
"base-dev",
"build-type-debug"
],
"condition": {
"type": "equals",
"lhs": "${hostSystemName}",
"rhs": "Windows"
}
}
],
"buildPresets": [
{
"name": "linux-static",
"inherits": [
"base-default"
],
"configurePreset": "linux-static"
},
{
"name": "linux-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "linux-static-dev"
},
{
"name": "x86-linux-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "x86-linux-static-dev"
},
{
"name": "osx-static",
"inherits": [
"base-default"
],
"configurePreset": "osx-static"
},
{
"name": "osx-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "osx-static-dev"
},
{
"name": "win-static",
"inherits": [
"base-default"
],
"configurePreset": "win-static"
},
{
"name": "win-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "win-static-dev"
},
{
"name": "arm64-linux-static",
"inherits": [
"base-default"
],
"configurePreset": "arm64-linux-static"
},
{
"name": "arm64-linux-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "arm64-linux-static-dev"
},
{
"name": "arm64-osx-static",
"inherits": [
"base-default"
],
"configurePreset": "arm64-osx-static"
},
{
"name": "arm64-osx-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "arm64-osx-static-dev"
},
{
"name": "arm64-win-static",
"inherits": [
"base-default"
],
"configurePreset": "arm64-win-static"
},
{
"name": "arm64-win-static-dev",
"inherits": [
"base-default"
],
"configurePreset": "arm64-win-static-dev"
}
]
}
Loading
Loading