-
Notifications
You must be signed in to change notification settings - Fork 12
102 lines (82 loc) · 3.19 KB
/
Pytests.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
98
99
100
101
name: Run PyTests
on:
push:
pull_request:
branches: ["master"]
env:
PY_COLORS: 1
jobs:
build:
name: Python ${{ matrix.python-version }} ${{ matrix.os }} ${{ matrix.mpi }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
# os: [ "ubuntu-18.04", "macos-11" ]
os: [ "ubuntu-22.04"]
python-version: ["3.9", "3.10" ]
mpi: [mpich, openmpi]
include:
- os: ubuntu-22.04
mpi: mpich
install-mpi: sudo apt install -y mpich libmpich-dev tree
- os: ubuntu-22.04
mpi: openmpi
install-mpi: sudo apt install -y openmpi-bin libopenmpi-dev tree
# - os: macos-11
# mpi: mpich
# install-mpi: brew install mpich tree
# - os: macos-11
# mpi: openmpi
# install-mpi: brew install open-mpi tree
steps:
- name: Checkout 🛎️
uses: "actions/checkout@v4"
- name: Install MPI 📥
run: |
${{ matrix.install-mpi }}
mpirun --version
which mpirun
which tree
- name: Set up Python ${{ matrix.python-version }} 🐍
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: System Info 💻
run: |
python -c "from multiprocessing import cpu_count ; print('cpu_count={}'.format(cpu_count()))"
if [ "$RUNNER_OS" == "macOS" ]; then
echo "***************************"
system_profiler SPHardwareDataType
echo "***************************"
elif [ "$RUNNER_OS" == "Linux" ]; then
echo "***************************"
lscpu | egrep 'Model name|Socket|Thread|NUMA|CPU\(s\)'
lshw -short -C memory
echo "***************************"
fi
python3 --version
python --version
- name: Install Python Dependencies 📥
run: |
python3 -m pip install --upgrade pip wheel
python3 -m pip install --upgrade -r requirements.txt
- name: Test with pytest 🚀
run: |
python3 setup.py install
git clone https://github.com/djgroen/FabFlee.git
# The two lines here are needed to run Action with OpenMPI. I don't know why (!!)
python3 -m pip install --upgrade pip wheel
python3 -m pip install --upgrade -r requirements.txt
export TMPDIR=/tmp
export OMPI_MCA_btl=self,tcp
export OMPI_MCA_btl_vader_backing_directory=/tmp
export FLEE_TYPE_CHECK=true
export PYTHONPATH=/home/runner/work/flee/flee:$PYTHONPATH
cd FabFlee/config_files/mali2012
mpiexec -n 2 python3 /home/runner/work/flee/flee/runscripts/run_par.py input_csv source_data 50 simsetting.yml
mpirun -n 2 python3 /home/runner/work/flee/flee/runscripts/run_par.py input_csv source_data 50 simsetting.yml
cd ../../..
echo "PYTHONPATH = $PYTHONPATH"
python3 -m pytest --log-cli-level=DEBUG tests/
python3 -m pytest --log-cli-level=DEBUG tests_mpi/