Update example #81
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: Windows | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build-windows: | |
runs-on: ${{ matrix.os }} | |
strategy: | |
matrix: | |
os: [windows-latest] | |
compiler: [gcc, clang, MSVC] | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v2 | |
- name: Install Ninja for gcc and clang | |
if: matrix.compiler == 'gcc' || matrix.compiler == 'clang' | |
run: choco install ninja -y | |
- name: Configure CMake for gcc | |
if: matrix.compiler == 'gcc' | |
run: | | |
$args = ( | |
"-DCMAKE_BUILD_TYPE=Release", | |
"-DCMAKE_C_COMPILER=gcc", | |
"-DCMAKE_CXX_COMPILER=g++", | |
"-G Ninja", | |
"-S .", | |
"-B build") | |
$args = $args -join ' ' | |
Invoke-Expression "cmake $args" | |
- name: Configure CMake for clang | |
if: matrix.compiler == 'clang' | |
run: | | |
$args = ( | |
"-DCMAKE_BUILD_TYPE=Release", | |
"-DCMAKE_C_COMPILER=clang", | |
"-DCMAKE_CXX_COMPILER=clang++", | |
"-G Ninja", | |
"-S .", | |
"-B build") | |
$args = $args -join ' ' | |
Invoke-Expression "cmake $args" | |
- name: Configure CMake for MSVC | |
if: matrix.compiler == 'MSVC' | |
run: cmake -S . -B build | |
- name: Build for gcc and clang | |
if: matrix.compiler == 'gcc' || matrix.compiler == 'clang' | |
run: cmake --build build | |
- name: Build for MSVC | |
if: matrix.compiler == 'MSVC' | |
run: cmake --build build --config Release | |
- name: Run tests for gcc and clang builds | |
if: matrix.compiler == 'gcc' || matrix.compiler == 'clang' | |
run: | | |
& ".\build\tests\run_tests.exe" | |
- name: Run tests for MSVC build | |
if: matrix.compiler == 'MSVC' | |
run: | | |
& ".\build\tests\Release\run_tests.exe" |