CI #226
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: CI | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
schedule: | |
# Run every Sunday at midnight | |
- cron: '0 0 * * 0' | |
defaults: | |
run: | |
shell: bash -l {0} | |
jobs: | |
build: | |
name: ${{ matrix.name }} | |
runs-on: ubuntu-22.04 | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
# Latest supported versions | |
- name: Linux (CUDA 12) | |
steps: | |
- name: Check out | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
submodules: recursive | |
- name: Show dependency file | |
run: cat environment.yml | |
- name: Install Mamba | |
uses: mamba-org/setup-micromamba@v1 | |
with: | |
environment-file: environment.yml | |
cache-environment: false | |
cache-downloads: true | |
- name: List environment | |
run: | | |
micromamba activate libmobility | |
micromamba list | |
- name: Configure and compile the library | |
run: | | |
micromamba activate libmobility | |
mkdir build && cd build | |
cmake -DCMAKE_VERBOSE_MAKEFILE=yes -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. | |
make -j3 all install | |
- name: Compile examples | |
run: | | |
micromamba activate libmobility | |
mkdir examples/cpp/build && cd examples/cpp/build | |
cmake -DCMAKE_VERBOSE_MAKEFILE=yes -DCMAKE_INSTALL_PREFIX=$CONDA_PREFIX .. | |
make -j3 | |
- name: Try to import libMobility | |
run: | | |
micromamba activate libmobility | |
python -c "import libMobility" | |
python -c "from libMobility import DPStokes, PSE, NBody, SelfMobility" | |
- name: Run pytest | |
run: | | |
micromamba activate libmobility | |
pytest -sv tests/test_initialization.py tests/test_precision.py | |
#Only SelfMobility tests can run in the CPU | |
pytest -sv -k SelfMobility tests/test*py | |
- name: Install docs dependencies | |
run: | | |
pip install -r docs/requirements.txt | |
shell: bash -el {0} | |
- name: Build Sphinx Documentation | |
run: | | |
cd docs | |
make html | |
shell: bash -el {0} | |
- name: Build conda package | |
run: | | |
micromamba activate libmobility | |
# install conda-build | |
micromamba install -c conda-forge conda-build | |
export CUDA_VERSION=12 | |
conda build devtools/conda-build | |
shell: bash -el {0} | |
- name: Install via pip | |
run: | | |
micromamba activate libmobility | |
pip install -vv . | |
shell: bash -el {0} |