Merge pull request #115 from farzeennadeem/master #484
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: 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/ | |