-
Notifications
You must be signed in to change notification settings - Fork 18
123 lines (105 loc) · 3.88 KB
/
continuous-integration.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
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
# This workflow will install Python dependencies and run tests with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Run tests
on:
push:
branches: [ devel ]
pull_request:
branches: [ devel ]
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: [ 3.8, 3.9, '3.10', '3.11' ]
isMerge:
- ${{ github.event_name == 'push' && github.ref == 'refs/heads/devel' }}
exclude:
- { isMerge: false, python-version: 3.9 }
- { isMerge: false, python-version: '3.10' }
include:
- os: macos-latest
python-version: 3.9
name: ${{ matrix.os }} / Python ${{ matrix.python-version }}
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install non-Python dependencies on Ubuntu
if: matrix.os == 'ubuntu-latest'
run: |
sudo apt-get update
sudo apt-get install gfortran
sudo apt-get install openmpi-bin libopenmpi-dev
sudo apt-get install libhdf5-openmpi-dev
- name: Install non-Python dependencies on macOS
if: matrix.os == 'macos-latest'
run: |
brew install open-mpi
brew install hdf5-mpi
brew install libomp
if [[ ! -f "/usr/local/bin/gfortran" ]]; then
gfort=$(ls /usr/local/bin/gfortran-* | tail -n 1)
ln -s ${gfort} /usr/local/bin/gfortran
fi
echo "MPI_OPTS=--oversubscribe" >> $GITHUB_ENV
- name: Print information on MPI and HDF5 libraries
run: |
ompi_info
h5pcc -showconfig -echo || true
- name: Upgrade pip
run: |
python -m pip install --upgrade pip
# - name: Get pip cache dir
# id: pip-cache-dir
# run: |
# echo "::set-output name=dir::$(python -m pip cache dir)"
#
# - name: pip cache
# uses: actions/cache@v2
# id: pip-cache
# with:
# path: ${{ steps.pip-cache-dir.outputs.dir }}
# key: ${{ matrix.os }}-${{ matrix.python-version }}-pip-${{ hashFiles('**/requirements.txt') }}
# restore-keys: |
# ${{ matrix.os }}-${{ matrix.python-version }}-pip-
- name: Determine directory of parallel HDF5 library
run: |
if [[ "${{ matrix.os }}" == "ubuntu-latest" ]]; then
export HDF5_DIR=/usr/lib/x86_64-linux-gnu/hdf5/openmpi
elif [[ "${{ matrix.os }}" == "macos-latest" ]]; then
export HDF5_DIR=$((h5pcc -showconfig -echo || true) | grep "Installation point:" | cut -d ":" -f2 | tr -d " ")
fi
echo $HDF5_DIR
- name: Install Python dependencies
run: |
export CC="mpicc" HDF5_MPI="ON"
python -m pip install -r requirements.txt
python -m pip install -r requirements_extra.txt --no-build-isolation
python -m pip list
- name: Check h5py installation
run: |
python3 -c "from h5py import File; print(File)"
- name: Install project
run: |
python -m pip install .
python -m pip freeze
- name: Initialize test directory
run: |
mkdir pytest
cp mpi_tester.py pytest
- name: Test with pytest
working-directory: ./pytest
run: |
export PSYDAC_MESH_DIR=$GITHUB_WORKSPACE/mesh
export OMP_NUM_THREADS=2
python -m pytest --pyargs psydac -m "not parallel"
python mpi_tester.py --pyargs psydac -m "parallel and not petsc"
- name: Remove test directory
if: ${{ always() }}
run: |
rm -rf pytest