-
Notifications
You must be signed in to change notification settings - Fork 9
73 lines (68 loc) · 2.4 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
# This workflow will install Python dependencies, run tests and lint 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: tests
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on: [push, pull_request]
jobs:
codecov:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.8"]
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 dependencies
run: |
python -m pip install --upgrade pip
pip install -e .[dev]
pip install coverage
- name: Download test data
run: python data/download_test_files.py > /dev/null
- name: Run pytest-cov
run: coverage run -m pytest --basetemp={envtmpdir}
- name: Create XML report
run: coverage xml
- uses: codecov/[email protected]
with:
file: ./coverage.xml
pytest:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9", "3.10", "3.11"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v1
id: cpu-cores
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt-get install graphviz -y
pip install -e .[dev]
- name: Download test data
run: python data/download_test_files.py > /dev/null
- name: Test with pytest (compiled)
run: |
PHASESPACE_EAGER=0 pytest --basetemp={envtmpdir} tests
cd docs
PHASESPACE_EAGER=0 pytest --dist loadscope --nbval-lax --ignore=.ipynb_checkpoints -n${{ steps.cpu-cores.outputs.count }}
cd ..
- name: Test with pytest (eager mode)
run: |
PHASESPACE_EAGER=1 pytest --basetemp={envtmpdir} tests
cd docs
PHASESPACE_EAGER=1 pytest --dist loadscope --nbval-lax --ignore=.ipynb_checkpoints -n${{ steps.cpu-cores.outputs.count }}
cd ..