Skip to content

CI

CI #151

Workflow file for this run

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@v2
with:
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
conda build conda
shell: bash -el {0}
- name: Install via pip
run: |
micromamba activate libmobility
pip install -vv .
shell: bash -el {0}