Files
dssp/.github/workflows/cmake-multi-platform.yml
2025-11-27 15:57:07 +01:00

105 lines
2.9 KiB
YAML

name: multi platform test
on:
push:
branches: [ "trunk", "develop" ]
pull_request:
branches: [ "trunk" ]
env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
BUILD_TYPE: Release
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest, windows-latest, macos-latest]
python-version: [ 3.13 ]
include:
- os: windows-latest
cpp_compiler: cl
- os: ubuntu-latest
cpp_compiler: g++
- os: macos-latest
cpp_compiler: clang++
steps:
- uses: actions/checkout@v4
- name: Set reusable strings
id: strings
shell: bash
run: echo "build-output-dir=${{ github.workspace }}/build" >> "$GITHUB_OUTPUT"
- name: Install Catch2 Ubuntu
if: matrix.os == 'ubuntu-latest'
run: >
sudo apt-get update && sudo apt-get install catch2 libpython3-all-dev libboost1.83-all-dev
- name: setup python
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install Catch2 macOS
if: matrix.os == 'macos-latest'
run: >
brew install catch2 boost-python3
- name: Install dependencies Window
if: matrix.os == 'windows-latest'
run: ./tools/depends.cmd
shell: cmd
- name: Checkout libcifpp
uses: actions/checkout@v4
with:
repository: pdb-redo/libcifpp
path: libcifpp
- name: Configure libcifpp
run: >
cmake
-B ${{github.workspace}}/libcifpp/build
-DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}}
-S ${{github.workspace}}/libcifpp
-DBUILD_DOCUMENTATION=OFF
-DBUILD_TESTING=OFF
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
- name: Build libcifpp
run: cmake --build ${{github.workspace}}/libcifpp/build --config ${{env.BUILD_TYPE}}
- name: Install libcifpp
if: matrix.os == 'windows-latest'
run: cmake --install ${{github.workspace}}/libcifpp/build --config ${{env.BUILD_TYPE}}
- name: Install libcifpp
if: matrix.os != 'windows-latest'
run: sudo cmake --install ${{github.workspace}}/libcifpp/build --config ${{env.BUILD_TYPE}}
- name: Configure CMake
run: >
cmake -B ${{ steps.strings.outputs.build-output-dir }}
-DCMAKE_CXX_COMPILER=${{ matrix.cpp_compiler }}
-DCMAKE_BUILD_TYPE=Release
-DBUILD_TESTING=ON
-DBUILD_PYTHON_MODULE=ON
-S ${{ github.workspace }}
-DCMAKE_INSTALL_PREFIX=${{github.workspace}}/local
- name: Build
run: cmake --build ${{ steps.strings.outputs.build-output-dir }} --config Release
- name: Test
working-directory: ${{ steps.strings.outputs.build-output-dir }}
run: ctest --build-config Release --output-on-failure
env:
LIBCIFPP_DATA_DIR: ${{ steps.strings.outputs.build-output-dir }}/_deps/cifpp-src/rsrc