Skip to content

[pre-commit.ci] pre-commit autoupdate #69

[pre-commit.ci] pre-commit autoupdate

[pre-commit.ci] pre-commit autoupdate #69

# Test if libyt can build with different options, download dependencies, and install and link correctly.
name: CMake Build Test
on:
push:
branches: [ main ]
paths-ignore:
- 'doc/**'
- '**.md'
pull_request:
branches: [ main ]
paths-ignore:
- 'doc/**'
- '**.md'
workflow_dispatch:
jobs:
cmake-build-test:
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: ubuntu-latest
mpi: 'openmpi'
check_shared_lib: ldd lib/libyt.so
- os: macos-12
mpi: 'mpich'
check_shared_lib: otool -l lib/libyt.dylib
python-version: ['3.7', '3.8', '3.9', '3.10', '3.11', '3.12']
steps:
- name: Checkout libyt repo
uses: actions/checkout@v4
- name: CMake Version
run: cmake --version
- name: Setup Python ${{ matrix.python-version }} environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
architecture: 'x64'
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install numpy
- name: Setup MPI environment
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.platform.mpi }}
- name: Update GitHub Environment Variables
run: |
echo "LIBYT_TEST_INSTALL_FOLDER=${{ github.workspace }}/libyt_installation" >> $GITHUB_ENV
- name: Test Option -DSERIAL_MODE=ON
run: |
cd ${{ github.workspace }}
rm -rf build
cmake -B build -S . -DSERIAL_MODE=ON
cmake --build build
cmake --install build --prefix "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-serial-on"
cd "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-serial-on"
${{ matrix.platform.check_shared_lib }}
- name: Test Option -DINTERACTIVE_MODE=ON
run: |
cd ${{ github.workspace }}
rm -rf build
cmake -B build -S . -DINTERACTIVE_MODE=ON
cmake --build build
cmake --install build --prefix "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-interactive-on"
cd "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-interactive-on"
${{ matrix.platform.check_shared_lib }}
- name: Test Option -DJUPYTER_KERNEL=ON
run: |
cd ${{ github.workspace }}
rm -rf build
cmake -B build -S . -DJUPYTER_KERNEL=ON
cmake --build build
cmake --install build --prefix "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-jupyter-on"
cd "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-jupyter-on"
${{ matrix.platform.check_shared_lib }}
- name: Test Option -DSUPPORT_TIMER=ON
run: |
cd ${{ github.workspace }}
rm -rf build
cmake -B build -S . -DSUPPORT_TIMER=ON
cmake --build build
cmake --install build --prefix "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-timer-on"
cd "${{ env.LIBYT_TEST_INSTALL_FOLDER }}/libyt-timer-on"
${{ matrix.platform.check_shared_lib }}