Skip to content

GHI #20 Setup pipelines and presets #23

GHI #20 Setup pipelines and presets

GHI #20 Setup pipelines and presets #23

Workflow file for this run

name: Run Tests
on:
pull_request:
branches:
- "**"
jobs:
test-native:
runs-on: ${{ matrix.platform.os }}
strategy:
matrix:
# verbose labels make things easier to read in GitHub Actions
platform:
- arch: windows-msvc-x86
os: windows-latest
preset: patomic-ci-windows-msvc -A Win32
- arch: windows-msvc-x64
os: windows-latest
preset: patomic-ci-windows-msvc -A x64
- arch: macos-clang-x86_64
os: macos-latest
preset: patomic-ci-macos-clang
- arch: ubuntu-clang-x86_64
os: ubuntu-latest
preset: patomic-ci-clang
- arch: ubuntu-clang-ansi-x86_64
os: ubuntu-latest
preset: patomic-ci-clang-ansi
- arch: ubuntu-gcc-x86_64
os: ubuntu-latest
preset: patomic-ci-gcc
- arch: ubuntu-gcc-ansi-x86_64
os: ubuntu-latest
preset: patomic-ci-gcc-ansi
# build-type:
# - debug
# - release
# build-shared:
# - static
# - shared
# include:
# # convert matrix options to cmake options
# - build-type: debug
# cmake-build-type: Debug
# - build-type: release
# cmake-build-type: Release
# - build-shared: static
# cmake-build-shared: OFF
# - build-shared: shared
# cmake-build-shared: ON
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.platform.preset }} -DCMAKE_CXX_FLAGS="" -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} ..
cmake --build . --config ${{ matrix.cmake-build-type }}
cmake --install . --config ${{ matrix.cmake-build-type }} --prefix install
- name: Build patomic
run: |
cd patomic
mkdir build
cd build
cmake --preset ${{ matrix.platform.preset }} -DBUILD_SHARED_LIBS=${{ matrix.cmake-build-shared }} -DCMAKE_BUILD_TYPE=${{ matrix.cmake-build-type }} -DGTest_DIR:PATH="../../googletest/build/install/lib/cmake/GTest" ..
cmake --build . --config ${{ matrix.cmake-build-type }}
- name: Test patomic
run: |
cd patomic/build
ctest -C ${{ matrix.cmake-build-type }} .