-
Notifications
You must be signed in to change notification settings - Fork 7
73 lines (60 loc) · 1.71 KB
/
CI.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
name: CI
on:
pull_request:
push:
branches:
- main
jobs:
test:
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
include:
- os: ubuntu-latest
python-version: "3.9"
mpi: ""
#doctest: true
- os: macos-latest
python-version: "3.11"
mpi: "mpich"
env:
MPICH_INTERFACE_HOSTNAME: localhost
USE_MPI: ${{ matrix.mpi }}
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }} on ${{ matrix.os }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Setup MPI
uses: mpi4py/setup-mpi@v1
if: matrix.mpi != ''
with:
mpi: ${{ matrix.mpi }}
- name: Pip install packages
if: ${{ ! matrix.oldest_deps }}
run: |
if [ -z "${{ matrix.mpi }}" ]; then
pip install 'netket' 'jax[cpu]'
else
pip install 'netket[mpi]' 'jax[cpu]'
fi
pip install -e '.[dev]'
- name: Run tests
run: |
export NETKET_EXPERIMENTAL=1
pytest --cov=netket_fidelity --cov-append test
- name: Run docstring tests
if: ${{ matrix.doctest }}
run: |
pytest --doctest-continue-on-failure --doctest-modules netket_fidelity/
- name: Run MPI tests
if: matrix.mpi != ''
run: |
mpirun -host localhost:2 -np 2 coverage run -m pytest test
coverage combine --append
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}