Skip to content

[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this #484

[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this

[DO NOT MERGE] Add tutorials for type-erasure, reflection and vanishing-this #484

Workflow file for this run

name: CMake test
on:
schedule:
- cron: "0 1 * * *"
push:
branches: [main]
paths:
- ".github/workflows/cmake.yml" # This file
- "**/*.cc"
- "**/*.h"
- "**/CMakeLists.txt"
- "CMakePresets.json"
- "**/*.cmake"
- "**/*.j2"
pull_request:
branches: [main]
paths:
- ".github/workflows/cmake.yml" # This file
- "**/*.cc"
- "**/*.h"
- "**/CMakeLists.txt"
- "CMakePresets.json"
- "**/*.cmake"
- "**/*.j2"
env:
UV_FROZEN: 1
jobs:
build:
name: ${{ matrix.settings.name }} ${{ matrix.configuration }}
runs-on: ${{ matrix.settings.os }}
strategy:
fail-fast: false
matrix:
configuration: ["Release", "Debug"]
settings:
- {
name: "Ubuntu GCC-11",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 11,
cc: "gcc-11",
cxx: "g++-11",
std: 20,
},
lib: "libstdc++11",
}
- {
name: "Ubuntu GCC-12",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 12,
cc: "gcc-12",
cxx: "g++-12",
std: 20,
},
lib: "libstdc++12",
}
- {
name: "Ubuntu GCC-13",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 13,
cc: "gcc-13",
cxx: "g++-13",
std: 20,
},
lib: "libstdc++13",
}
- {
name: "Ubuntu GCC-14",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 14,
cc: "gcc-14",
cxx: "g++-14",
std: 20,
},
lib: "libstdc++14",
}
- {
name: "Ubuntu GCC-14 (C++23)",
os: ubuntu-24.04,
compiler:
{
type: GCC,
version: 14,
cc: "gcc-14",
cxx: "g++-14",
std: 23,
},
lib: "libstdc++14",
}
- {
name: "Ubuntu Clang-17 + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 17,
cc: "clang-17",
cxx: "clang++-17",
std: 20,
},
lib: "libc++17",
}
- {
name: "Ubuntu Clang-18 + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 18,
cc: "clang-18",
cxx: "clang++-18",
std: 20,
},
lib: "libc++18",
}
- {
name: "Ubuntu Clang-19 + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 19,
cc: "clang-19",
cxx: "clang++-19",
std: 20,
},
lib: "libc++19",
}
- {
name: "Ubuntu Clang-20 + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 19,
cc: "clang-20",
cxx: "clang++-20",
std: 20,
},
lib: "libc++20",
}
- {
name: "Ubuntu Clang-21 + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 21,
cc: "clang-21",
cxx: "clang++-21",
std: 20,
},
lib: "libc++21",
}
- {
name: "Ubuntu Clang-21 (C++23) + libc++",
os: ubuntu-24.04,
compiler:
{
type: CLANG,
version: 21,
cc: "clang-21",
cxx: "clang++-21",
std: 23,
},
lib: "libc++21",
}
- {
name: "Visual Studio 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, cc: "cl", cxx: "cl" },
}
- {
name: "Visual Studio 2022 v17",
os: windows-latest,
compiler: { type: VISUAL, version: 17, cc: "cl", cxx: "cl" },
}
- {
name: "Visual Studio 2022 v18",
os: windows-latest,
compiler: { type: VISUAL, version: 18, cc: "cl", cxx: "cl" },
}
- {
name: "Visual Studio 2022 v19",
os: windows-latest,
compiler: { type: VISUAL, version: 19, cc: "cl", cxx: "cl" },
}
- {
name: "MacOS Apple Clang 15",
os: macos-14,
compiler:
{
type: APPLE_CLANG,
version: "15.0",
cc: "clang",
cxx: "clang++",
std: 20,
},
}
- {
name: "Ubuntu GCC-16 (C++26 Reflection)",
os: ubuntu-24.04,
compiler:
{
type: GCC16,
version: 16,
cc: "gcc-16",
cxx: "g++-16",
std: 26,
},
}
steps:
- uses: actions/checkout@v4
- uses: seanmiddleditch/gha-setup-ninja@master
- name: Add msbuild to PATH
if: matrix.settings.os == 'windows-latest'
uses: microsoft/setup-msbuild@v2
with:
vs-version: "16.5"
- name: Install Latest GCC
if: matrix.settings.compiler.type == 'GCC'
uses: egor-tensin/setup-gcc@v1
with:
version: ${{ matrix.settings.compiler.version }}
platform: x64
- name: Install Clang
if: matrix.settings.compiler.type == 'CLANG'
uses: egor-tensin/setup-clang@v1
with:
version: ${{ matrix.settings.compiler.version }}
platform: x64
- name: Install GCC 16 from ubuntu-toolchain-r PPA
if: matrix.settings.compiler.type == 'GCC16'
run: |
sudo add-apt-repository -y ppa:ubuntu-toolchain-r/test
sudo apt-get update
sudo apt-get install -y --no-install-recommends g++-16 gcc-16
echo "CC=gcc-16" >> "$GITHUB_ENV"
echo "CXX=g++-16" >> "$GITHUB_ENV"
- name: Install uv
uses: astral-sh/setup-uv@v5
- name: Set up Python
run: uv sync
- name: Run CMake
run: ./scripts/cmake.sh --${{ matrix.configuration == 'Debug' && 'debug' || 'release' }} ${{ matrix.settings.compiler.type == 'GCC16' && '-DXYZ_PROTOCOL_BUILD_REFLECTION_TUTORIAL=ON' || '' }}