-
Notifications
You must be signed in to change notification settings - Fork 0
97 lines (83 loc) · 2.4 KB
/
ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
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}