Make a smoke test CI for PRs #2
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: ci-pr | |
on: | |
pull_request: | |
branches: | |
- main | |
env: | |
VERBOSE: 1 | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-20.04 | |
- macos-10.15 | |
- windows-2019 | |
compiler: | |
# you can specify the version after `-` like "llvm-15.0.2". | |
- llvm-15.0.2 | |
- gcc-11 | |
generator: | |
- "Ninja Multi-Config" | |
build_type: | |
- Debug | |
packaging_maintainer_mode: | |
- OFF | |
build_shared: | |
- OFF | |
exclude: | |
# mingw is determined by this author to be too buggy to support | |
- os: windows-2019 | |
compiler: gcc-11 | |
include: | |
# Windows msvc builds | |
- os: windows-2022 | |
compiler: msvc | |
generator: "Visual Studio 17 2022" | |
build_type: Debug | |
packaging_maintainer_mode: Off | |
enable_ipo: On | |
steps: | |
- name: Check for llvm version mismatches | |
if: ${{ contains(matrix.compiler, 'llvm') && !contains(matrix.compiler, env.CLANG_TIDY_VERSION) }} | |
uses: actions/github-script@v3 | |
with: | |
script: | | |
core.setFailed('There is a mismatch between configured llvm compiler and clang-tidy version chosen') | |
- uses: actions/checkout@v3 | |
- name: Setup Cache | |
uses: ./.github/actions/setup_cache | |
with: | |
compiler: ${{ matrix.compiler }} | |
build_type: ${{ matrix.build_type }} | |
packaging_maintainer_mode: ${{ matrix.packaging_maintainer_mode }} | |
generator: ${{ matrix.generator }} | |
- name: Project Name | |
uses: cardinalby/export-env-action@v2 | |
with: | |
envFile: '.github/constants.env' | |
- name: Setup Cpp | |
uses: aminya/setup-cpp@v1 | |
with: | |
compiler: ${{ matrix.compiler }} | |
vcvarsall: ${{ contains(matrix.os, 'windows' )}} | |
cmake: true | |
ninja: true | |
vcpkg: false | |
ccache: true | |
clangtidy: false | |
- name: Configure CMake | |
run: | | |
cmake -S . -B ./build -G "${{matrix.generator}}" -D${{ env.PROJECT_NAME }}_ENABLE_IPO=${{matrix.enable_ipo }} -DCMAKE_BUILD_TYPE:STRING=${{matrix.build_type}} -D${{ env.PROJECT_NAME }}_PACKAGING_MAINTAINER_MODE:BOOL=${{matrix.packaging_maintainer_mode}} -D${{ env.PROJECT_NAME }}_ENABLE_COVERAGE:BOOL=${{ matrix.build_type == 'Debug' }} -DGIT_SHA:STRING=${{ github.sha }} | |
- name: Build | |
# Execute the build. You can specify a specific target with "--target <NAME>" | |
run: | | |
cmake --build ./build --config ${{matrix.build_type}} | |
- name: Tests | |
working-directory: ./build | |
run: | | |
ctest -C ${{matrix.build_type}} |