-
Notifications
You must be signed in to change notification settings - Fork 6
68 lines (66 loc) · 2.06 KB
/
main.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
name: CI
on:
push: # Add these lines after public release
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11"]
mpi: ["mpich", "openmpi"]
exclude:
- os: macos-latest
mpi: "mpich" # Brew hdf5-mpi only support openmpi
include:
- os: ubuntu-latest
path: |
~/.cache/pypoetry
~/.cache/pip
- os: macos-latest
path: |
~/Library/Caches/pypoetry
~/Library/Caches/pip
runs-on: ${{ matrix.os }}
steps:
- uses: actions/checkout@v2
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
with:
mpi: ${{ matrix.mpi }}
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
with:
python-version: ${{ matrix.python-version }}
- name: Install Poetry
uses: snok/install-poetry@v1
- name: Set up cache
id: cached-python-dependencies
uses: actions/cache@v3
with:
path: ${{ matrix.path }}
key: ${{ runner.os }}-pip-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Install background dependency (MacOS)
if: startsWith(runner.os, 'macOS')
run: |
brew install hdf5-mpi
- name: Install background dependency (Ubuntu)
if: startsWith(runner.os, 'Linux')
run: |
sudo apt-get install -y libhdf5-mpi-dev python3-dev # Install hdf5-mpi
- name: Install poetry dependencies
if: steps.cached-python-dependencies.outputs.cache-hit != 'true'
run: |
pip install numpy mpi4py
poetry config virtualenvs.in-project false
poetry install
- name: Check style
run: |
make check-codestyle
- name: Run tests
run: |
make test