Skip to content

CMake

CMake #81

Workflow file for this run

name: CMake
on:
schedule:
- cron: "0 1 * * *"
push:
branches: [main]
paths-ignore:
- CODEOWNERS
- requirements.txt
- LICENSE.txt
- .pre-commit-config.yaml
- '**/*.md'
- '**/*.yml'
pull_request:
branches: [main]
paths-ignore:
- CODEOWNERS
- requirements.txt
- LICENSE.txt
- .pre-commit-config.yaml
- '**/*.md'
- '**/*.yml'
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-22.04,
compiler:
{ type: GCC, version: 11, cc: "gcc-11", cxx: "g++-11", std: 20 },
lib: "libstdc++11",
}
- {
name: "Ubuntu GCC-12",
os: ubuntu-22.04,
compiler:
{ type: GCC, version: 12, cc: "gcc-12", cxx: "g++-12", std: 20},
lib: "libstdc++12",
}
- {
name: "Ubuntu GCC-13",
os: ubuntu-22.04,
compiler:
{ type: GCC, version: 13, cc: "gcc-13", cxx: "g++-13", std: 20},
lib: "libstdc++13",
}
- {
name: "Ubuntu Clang-17 + libc++",
os: ubuntu-22.04,
compiler:
{ type: CLANG, version: 17, cc: "clang-17", cxx: "clang++-17", std: 20},
lib: "libc++17",
}
- {
name: "Ubuntu Clang-18 + libc++",
os: ubuntu-22.04,
compiler:
{ type: CLANG, version: 18, cc: "clang-18", cxx: "clang++-18", std: 20},
lib: "libc++18",
}
- {
name: "Visual Studio 2019",
os: windows-latest,
compiler: { type: VISUAL, version: 16, cc: "cl", cxx: "cl" },
}
- {
name: "Visual Studio 2022",
os: windows-latest,
compiler: { type: VISUAL, version: 17, 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,
},
}
steps:
- uses: actions/checkout@v2
- name: Add msbuild to PATH
if: matrix.settings.os == 'windows-latest'
uses: microsoft/setup-msbuild@v1.0.2
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: Select Xcode 14.0
if: matrix.config.compiler.type == 'APPLE_CLANG' && matrix.config.compiler.version == '14.0'
shell: bash
run: |
sudo xcode-select -s "/Applications/Xcode_14.0.app"
- name: Configure CMake
# Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{ matrix.configuration }}
- name: Build
# Build your program with the given configuration
run: cmake --build ${{github.workspace}}/build --config ${{ matrix.configuration }}
- name: Test
working-directory: ${{github.workspace}}/build
# Execute tests defined by the CMake configuration.
# See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail
run: ctest -C ${{ matrix.configuration }}