Skip to content

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

[pre-commit.ci] pre-commit autoupdate

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

# Test if libyt can build with different options, download dependencies, and install and link correctly.
name: build test
permissions:
contents: read
on:
push:
branches: [ main ]
paths-ignore:
- 'doc/**'
- '**.md'
pull_request:
branches: [ main ]
paths-ignore:
- 'doc/**'
- '**.md'
workflow_dispatch:
jobs:
cmake-build-test:
name: ${{ matrix.platform.os }}
runs-on: ${{ matrix.platform.os }}
strategy:
fail-fast: false
matrix:
platform:
- os: 'ubuntu-latest'
install_dep_command: 'sudo apt-get install -y libreadline-dev uuid-dev'
- os: 'macos-latest'
install_dep_command: 'brew install readline'
mpi_compiler: ['openmpi']
python_version: ['3.10']
steps:
- uses: actions/checkout@v4
- name: Setup MPI ${{ matrix.mpi_compiler }} environment
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi_compiler }}
- name: Setup Python ${{ matrix.python_version }} environment
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python_version }}
cache: 'pip'
- run: |
python -m pip install --upgrade pip
pip install numpy
- name: Install other dependencies
run: |
${{ matrix.platform.install_dep_command }}
- name: Set reusable strings
id: strings
shell: bash
run: |
echo "install-prefix=${{ github.workspace }}/libyt-install" >> "$GITHUB_OUTPUT"
- name: Test Option -DUSE_PYBIND11=ON
run: |
cd ${{ github.workspace }}
rm -rf build
cmake -B build -S . -DUSE_PYBIND11=ON
cmake --build build
cmake --install build --prefix "${{ steps.strings.outputs.install-prefix }}/libyt-use_pybind11-on"
cd "${{ steps.strings.outputs.install-prefix }}/libyt-use_pybind11-on"
- 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 "${{ steps.strings.outputs.install-prefix }}/libyt-serial-on"
cd "${{ steps.strings.outputs.install-prefix }}/libyt-serial-on"
- 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 "${{ steps.strings.outputs.install-prefix }}/libyt-interactive-on"
cd "${{ steps.strings.outputs.install-prefix }}/libyt-interactive-on"
- 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 "${{ steps.strings.outputs.install-prefix }}/libyt-jupyter-on"
cd "${{ steps.strings.outputs.install-prefix }}/libyt-jupyter-on"
- 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 "${{ steps.strings.outputs.install-prefix }}/libyt-timer-on"
cd "${{ steps.strings.outputs.install-prefix }}/libyt-timer-on"