-
Notifications
You must be signed in to change notification settings - Fork 13
75 lines (70 loc) · 2.5 KB
/
linux.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
name: Build and test
on: [push, pull_request]
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: [ '3.7.15', '3.8.12', '3.9.7', '3.10.4', '3.11.0' ]
# python-version: [ '3.7', '3.8', '3.9', '3.10' ]
steps:
- uses: actions/checkout@v2
- name: "Setup Python ${{ matrix.python-version }}"
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Start Xvfb
run: |
export DISPLAY=:99.0
Xvfb -ac :99 -screen 0 1280x1024x16 > /dev/null 2>&1 &
- name: Install dependencies
run: |
sudo apt -y update
sudo apt -y install cmake libjpeg-dev libtiff-dev freeglut3-dev libxi-dev libxmu-dev
sudo apt -y install libvtk7-dev vtk7
sudo apt -y install xvfb
- name: Configure smoldyn
run: |
cmake --version
PYTHON=$(which python)
$PYTHON -c "import sys; print(sys.version)"
$PYTHON -m pip install pytest matplotlib numpy wheel flaky
mkdir build && cd build
cmake -DOPTION_PYTHON=ON \
-DOPTION_EXAMPLES=ON \
-DPython3_EXECUTABLE=$PYTHON ..
- name: Build smoldyn
run: |
cd build && make -j2 && make wheel && sudo make install
- name: Test smoldyn
run: |
cd build && xvfb-run --auto-servernum ctest --output-on-failure -j2
python -m pip install smoldyn*.whl
python -c "import smoldyn; print(smoldyn.__file__); print(smoldyn.__version__)"
# BioSimulators
- name: Build BioSimulators Docker image
if: matrix.python-version >= '3.9'
run: |
cp build/smoldyn*.whl scripts/
cd scripts
docker build \
--file Dockerfile-BioSimulators \
--tag ghcr.io/ssandrews/smoldyn/biosimulators_smoldyn:latest \
.
- name: Lint BioSimulators
if: matrix.python-version >= '3.9'
run: |
python -m pip install --upgrade pip
python -m pip install flake8
flake8 source/python/smoldyn/biosimulators/ --ignore E501,W503
- name: Install BioSimulators
if: matrix.python-version >= '3.9'
run: |
cd build
WHEEL_PATH=$(ls smoldyn*.whl)
python -m pip install --force-reinstall "${WHEEL_PATH}[biosimulators,biosimulators-tests]"
- name: Test BioSimulators
if: matrix.python-version >= '3.9'
run: |
python -m pip install pytest flaky
xvfb-run --auto-servernum python -m pytest tests/test_biosimulators.py --verbose