diff --git a/.github/workflows/build-and-run-tests.yml b/.github/workflows/build-and-run-tests.yml index 822c85e..c95fbed 100644 --- a/.github/workflows/build-and-run-tests.yml +++ b/.github/workflows/build-and-run-tests.yml @@ -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 }} @@ -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