Skip to content

Commit

Permalink
[test] try to extend the CI to windows
Browse files Browse the repository at this point in the history
  • Loading branch information
Quuxplusone committed Oct 18, 2023
1 parent 1f15702 commit 4e5e361
Showing 1 changed file with 35 additions and 21 deletions.
56 changes: 35 additions & 21 deletions .github/workflows/build-and-run-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,24 +9,16 @@ on:
jobs:
build:
strategy:
fail-fast: true
fail-fast: false

matrix:
os: [ubuntu-latest, windows-latest]
build_type: [Debug, RelWithDebInfo, Release]
cpp_compiler: [g++, clang++]
cpp_standard: [14, 17, 20, 23]
build_type: [Debug]
cpp_compiler: [g++, clang++, cl]
cpp_standard: [14]
exclude:
- os: ubuntu-latest
cpp_compiler: clang++
cpp_standard: 20
- os: ubuntu-latest
cpp_compiler: clang++
cpp_standard: 23
- os: windows-latest
cpp_compiler: clang++
- os: windows-latest
cpp_compiler: g++

runs-on: ${{ matrix.os }}

Expand All @@ -35,15 +27,37 @@ jobs:

- name: Install Google Test (Linux)
if: matrix.os == 'ubuntu-latest'
run: |
run: >
sudo apt-get install libgtest-dev
- name: Build and Test
- name: Install Google Test (Windows)
if: matrix.os == 'windows-latest'
run: >
git clone https://github.com/google/googletest.git &&
mkdir googletest/build &&
cd googletest/build &&
cmake .. -G 'Unix Makefiles' &&
make install
- name: Build (Linux)
if: matrix.os == 'ubuntu-latest'
working-directory: ${{ github.workspace }}
env:
CMAKE_CXX_COMPILER: ${{ matrix.cpp_compiler }}
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
run: |
cmake -S . -B ./build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }}
- name: Build (Windows)
if: matrix.os == 'windows-latest'
working-directory: ${{ github.workspace }}
env:
CMAKE_CXX_COMPILER: ${{ matrix.cpp_compiler }}
CMAKE_BUILD_TYPE: ${{ matrix.build_type }}
run: |
cmake -S . -B ./build -DCMAKE_CXX_STANDARD=${{ matrix.cpp_standard }} -DGTEST_ROOT="C:/Program Files (x86)/googletest-distribution"
- name: Test
working-directory: ${{ github.workspace }}/build
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
make && ./bin/utest

0 comments on commit 4e5e361

Please sign in to comment.