-
Notifications
You must be signed in to change notification settings - Fork 7
94 lines (83 loc) · 3.19 KB
/
tests.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
# The name is short because we mostly care how it appears in the pull request
# "checks" dialogue box - it looks like
# Tests / ubuntu-latest, python-3.9, defaults
# or similar.
name: Tests
on:
[push, pull_request]
defaults:
run:
# The slightly odd shell call is to force bash to read .bashrc, which is
# necessary for having conda behave sensibly. We use bash as the shell even
# on Windows, since we don't run anything much complicated, and it makes
# things much simpler.
shell: bash -l {0}
jobs:
cases:
name: ${{ matrix.os }}, ${{ matrix.case-name }}
runs-on: ${{ matrix.os }}
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
python-version: [3.9]
case-name: [defaults]
steps:
- uses: actions/checkout@v2
- uses: conda-incubator/setup-miniconda@v2
with:
auto-update-conda: true
python-version: ${{ matrix.python-version }}
- name: Install QuTiP from GitHub
run: |
python -mpip install git+https://github.com/qutip/qutip.git@master
python -c 'import qutip; qutip.about()'
- name: Install qutip-jax and dependencies
# Install in editable mode so Coveralls detects the tree structure
# relative to the git repository root as well.
run: |
python -mpip install -e .[full]
python -mpip install pytest-cov coveralls
- name: Package information
run: |
conda list
python -c 'import qutip_jax; print(qutip_jax.__version__)'
- name: Run tests
# If our tests are running for longer than an hour, _something_ is wrong
# somewhere. The GitHub default is 6 hours, which is a bit long to wait
# to see if something hung.
timeout-minutes: 60
run: |
pytest --durations=0 --durations-min=1.0 --verbosity=1 --cov=qutip_jax --color=yes -W ignore::UserWarning:qutip
# Above flags are:
# --durations=0 --durations-min=1.0
# at the end, show a list of all the tests that took longer than a
# second to run
# --verbosity=1
# turn the verbosity up so pytest prints the names of the tests
# it's currently working on
# --cov=qutip_jax
# limit coverage reporting to code that's within the qutip_jax package
# --color=yes
# force coloured output in the terminal
# -W ignore::UserWarning:qutip
# Ignore matplotlib missing warnings
# These flags are added to those in pyproject.toml.
- name: Upload to Coveralls
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
COVERALLS_FLAG_NAME: ${{ matrix.os }}-${{ matrix.python-version }}-${{ matrix.case-name }}
COVERALLS_PARALLEL: true
run: coveralls --service=github
finalise:
name: Finalise coverage reporting
needs: cases
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finalise coverage reporting
env:
GITHUB_TOKEN: ${{ secrets.github_token }}
run: |
python -mpip install coveralls
coveralls --service=github --finish