Skip to content

GHI #20 Setup pipelines and presets #9

GHI #20 Setup pipelines and presets

GHI #20 Setup pipelines and presets #9

Workflow file for this run

name: Run Tests
on:
pull_request:
branches:
- "**"
jobs:
test-native:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-latest, macos-latest, ubuntu-latest]
build-type: [Debug, Release]
build-shared: [OFF, ON]
include:
- os: windows-latest
preset: patomic-ci-windows-msvc
- os: macos-latest
preset: patomic-ci-unix-clang
- os: ubuntu-latest
preset: patomic-ci-unix-clang
- os: ubuntu-latest
preset: patomic-ci-unix-clang-ansi
- os: ubuntu-latest
preset: patomic-ci-unix-gcc
- os: ubuntu-latest
preset: patomic-ci-unix-gcc-ansi
steps:
- name: Checkout patomic
uses: actions/checkout@v4
with:
path: patomic
- name: Checkout GoogleTest
uses: actions/checkout@v4
with:
repository: google/googletest
path: googletest
- name: Build and Install GoogleTest
run: |
cd googletest
cp ../patomic/CMakePresets.json .
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DCMAKE_CXX_FLAGS="" -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} ..
cmake --build . --config ${{ matrix.build-type }}
cmake --install . --config ${{ matrix.build-type }} --prefix install
- name: Build patomic
run: |
cd patomic
mkdir build
cd build
cmake --preset ${{ matrix.preset }} -DBUILD_SHARED_LIBS=${{ matrix.build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.build-type }} -DGTest_DIR:PATH="../../googletest/build/install/lib/cmake/GTest" ..
cmake --build . --config ${{ matrix.build-type }}
- name: Test patomic
run: |
cd patomic/build
ctest -C ${{ matrix.build-type }} .