1
- # evaluating GitHub actions for CI, disconsider failures when evaluating PRs
1
+ # evaluating GitHub actions for CI, disregard failures when evaluating PRs
2
2
#
3
3
# this is still missing:
4
4
# - deploy
5
- # - coverage
6
5
# - upload github notes
7
6
#
8
7
name : main
17
16
18
17
jobs :
19
18
build :
20
-
21
19
runs-on : ${{ matrix.os }}
22
20
23
21
strategy :
86
84
python : " 3.7"
87
85
os : ubuntu-latest
88
86
tox_env : " py37-freeze"
87
+ # coverage does not apply for freeze test, skip it
88
+ skip_coverage : true
89
89
- name : " ubuntu-py38"
90
90
python : " 3.8"
91
91
os : ubuntu-latest
94
94
python : " pypy3"
95
95
os : ubuntu-latest
96
96
tox_env : " pypy3-xdist"
97
+ # coverage too slow with pypy3, skip it
98
+ skip_coverage : true
97
99
98
100
- name : " macos-py37"
99
101
python : " 3.7"
@@ -118,6 +120,37 @@ jobs:
118
120
- name : Install dependencies
119
121
run : |
120
122
python -m pip install --upgrade pip
121
- pip install tox
122
- - name : Test
123
- run : tox -e ${{ matrix.tox_env }}
123
+ pip install tox coverage
124
+
125
+ - name : Test without coverage
126
+ if : " matrix.skip_coverage"
127
+ run : " tox -e ${{ matrix.tox_env }}"
128
+
129
+ - name : Test with coverage
130
+ if : " ! matrix.skip_coverage"
131
+ env :
132
+ _PYTEST_TOX_COVERAGE_RUN : " coverage run -m"
133
+ COVERAGE_PROCESS_START : " .coveragerc"
134
+ _PYTEST_TOX_EXTRA_DEP : " coverage-enable-subprocess"
135
+ run : " tox -e ${{ matrix.tox_env }}"
136
+
137
+ - name : Prepare coverage token
138
+ if : success() && !matrix.skip_coverage && ( github.repository == 'pytest-dev/pytest' || github.event_name == 'pull_request' )
139
+ run : |
140
+ python scripts/append_codecov_token.py
141
+
142
+ - name : Combine coverage
143
+ if : success() && !matrix.skip_coverage
144
+ run : |
145
+ python -m coverage combine
146
+ python -m coverage xml
147
+
148
+ - name : Codecov upload
149
+ if : success() && !matrix.skip_coverage
150
+ uses : codecov/codecov-action@v1
151
+ with :
152
+ token : ${{ secrets.codecov }}
153
+ file : ./coverage.xml
154
+ flags : ${{ runner.os }}
155
+ fail_ci_if_error : false
156
+ name : ${{ matrix.name }}
0 commit comments