cleanup (#38) #181
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: Tests | |
on: | |
pull_request: | |
branches: [ master ] | |
push: | |
branches: [ master ] | |
jobs: | |
test: | |
runs-on: ${{matrix.operatingsystems}} | |
env: | |
BUILD_TYPE: ${{matrix.buildtypes}} | |
strategy: | |
matrix: | |
operatingsystems: [windows-latest, ubuntu-latest, macos-latest] | |
buildtypes: [Release] | |
steps: | |
- uses: actions/checkout@v4 | |
# Windoof setup | |
- name: Cache Chocolatey packages | |
if: runner.os == 'Windows' | |
uses: actions/cache@v3 | |
with: | |
path: | | |
~\AppData\Local\Temp\chocolatey | |
C:\ProgramData\chocolatey\lib\ninja | |
key: ${{ runner.os }}-choco-${{ hashFiles('**/Test.yaml') }} | |
- name: Setup Ninja under Windows | |
if: runner.os == 'Windows' | |
run: choco install ninja -y | |
- name: Setup MSVC under Windows | |
if: runner.os == 'Windows' | |
uses: ilammy/msvc-dev-cmd@v1 | |
# Schlinux setup | |
- name: Setup Dependencies under Linux | |
if: runner.os == 'Linux' | |
run: | | |
mkdir -p ~/.cache/apt ~/.local/share/apt | |
sudo apt-get update | |
sudo apt install software-properties-common | |
sudo add-apt-repository ppa:ubuntu-toolchain-r/test | |
sudo apt-get update | |
env: | |
DEBIAN_FRONTEND: noninteractive | |
- name: Install Packages cached | |
if: runner.os == 'Linux' | |
uses: awalsh128/cache-apt-pkgs-action@latest | |
with: | |
packages: cmake ninja-build gcc-13 g++-13 | |
version: 1.0 | |
# SchmockOS setup | |
- name: Setup Dependencies under MacOS | |
if: runner.os == 'macOS' | |
run: | | |
brew install \ | |
ninja \ | |
${NULL+} | |
- name: Configure CMake under Windows | |
if: runner.os == 'Windows' | |
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja -DBUILD_TESTS=ON -DBUILD_SOLUTIONS=OFF | |
- name: Configure Cmake under Linux or MacOS | |
if: runner.os == 'Linux' || runner.os == 'macOS' | |
run: cmake -D CMAKE_C_COMPILER=gcc-13 -D CMAKE_CXX_COMPILER=g++-13 -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -G Ninja -DBUILD_TESTS=ON -DBUILD_SOLUTIONS=OFF | |
- name: Build tests | |
run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} | |
- name: Run tests | |
working-directory: ${{github.workspace}}/build | |
run: ctest -C ${{env.BUILD_TYPE}} |