Skip to content

windows

windows #36

Workflow file for this run

name: Build and run tests
on:
push:
branches: [ "master" ]
pull_request:
branches: [ "master" ]
jobs:
build:
strategy:
# Set fail-fast to false to ensure that feedback is delivered for all matrix combinations.
# Consider changing this to true when your workflow is stable.
fail-fast: false
# [Debug, Release, RelWithDebInfo]
# [g++, clang++, cl]
# [14, 17, 20, 23]
#
matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug]
cpp_compiler: [clang++, cl]
cpp_standard: [14]
exclude:
- os: windows-latest
cpp_compiler: g++
- os: ubuntu-latest
cpp_compiler: cl
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v3
- name: Install Google Test (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get install libgtest-dev
- name: Install Google Test (Windows MSVC)
if: matrix.os == 'windows-latest' && matrix.cpp_compiler == 'cl'
run: |
git clone https://github.com/google/googletest.git
mkdir googletest/build
cd googletest/build
cmake ..
dir
dir *
find .
make install
- name: Install Google Test (Windows Cygwin)
if: matrix.os == 'windows-latest' && matrix.cpp_compiler != 'cl'
run: |
git clone https://github.com/google/googletest.git
mkdir googletest/build
cd googletest/build
cmake ..
dir
dir *
find .
make install
# Configure CMake in a 'build' subdirectory.
# `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make.
# https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type
#
- name: Configure CMake
run: |
cmake -S ${{ github.workspace }} -B ${{ github.workspace }}/build \
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }} \
-DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} \
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
cd ${{ github.workspace }}/build
make
./bin/utest