-
Notifications
You must be signed in to change notification settings - Fork 8
130 lines (103 loc) · 3.27 KB
/
pytest.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
124
125
126
127
128
129
130
name: PyTest
on:
push:
branches:
- main
pull_request:
branches:
- main
jobs:
orderly:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
group: [1, 2, 3, 4, 5]
timeout-minutes: 15
steps:
- name: Check out repository code
uses: actions/checkout@v2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install libpq-dev
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libpq-dev
- name: Install poetry
uses: Gr1N/setup-poetry@v8
- name: Set Poetry config
run: |
poetry config virtualenvs.in-project true
poetry config virtualenvs.path ~/.virtualenvs
# run poetry install if the poetry lock has changed
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: poetry install --no-interaction --no-root
- name: Run test suite
run: poetry run pytest -v --cov --ignore=condition_prediction --splits 5 --group ${{ matrix.group }} --splitting-algorithm least_duration
- name: Upload coverage
uses: actions/upload-artifact@v2
with:
name: coverage${{ matrix.group }}
path: .coverage
orderly_coverage:
needs: orderly
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.8
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Install coverage
run: pip install coverage
- name: Download all artifacts
# Downloads coverage1, coverage2, etc.
uses: actions/download-artifact@v2
- name: Run coverage
run: |
coverage combine coverage*/.coverage*
coverage report --fail-under=85
coverage html
- name: Upload
uses: actions/upload-artifact@v1
with:
name: coverage
path: htmlcov
condition_prediction:
runs-on: ubuntu-latest
strategy:
fail-fast: false
timeout-minutes: 10
steps:
- name: Check out repository code
uses: actions/checkout@v2
# Setup Python (faster than using Python container)
- name: Setup Python
uses: actions/setup-python@v2
with:
python-version: "3.10"
- name: Install libpq-dev
if: matrix.os == 'ubuntu-latest'
run: sudo apt-get install -y libpq-dev
- name: Install poetry
run: python -m pip install --upgrade poetry wheel
# - name: Add coverage
# run: poetry add pytest-cov
# - name: Set Poetry config
# run: |
# poetry config virtualenvs.in-project true
# poetry config virtualenvs.path ~/.virtualenvs
# run poetry install if the poetry lock has changed
- name: Install dependencies
if: steps.cache-poetry.outputs.cache-hit != 'true'
run: cd condition_prediction && poetry install --no-interaction
- name: Run test suite
run: cd condition_prediction && poetry run pytest -v
# - name: Upload
# uses: actions/upload-artifact@v1
# with:
# name: coverage
# path: htmlcov