@@ -166,16 +166,16 @@ jobs:
166
166
pip list
167
167
pip install setuptools==28.8.0 wheel==0.30.0a0
168
168
- name : Install instrumental
169
- if : ${{ contains(matrix.tox-env , 'instrumental') }}
169
+ if : ${{ contains(matrix.opt-deps , 'instrumental') }}
170
170
run : pip install instrumental
171
171
- name : Install gmpy
172
172
if : ${{ contains(matrix.tox-env, 'gmpyp') }}
173
173
run : pip install gmpy
174
174
- name : Install gmpy2 dependencies
175
- if : ${{ contains(matrix.tox-env, 'gmpy2') }}
175
+ if : ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
176
176
run : sudo apt-get install -y libmpfr-dev libmpc-dev
177
177
- name : Install gmpy2
178
- if : ${{ contains(matrix.tox-env, 'gmpy2') }}
178
+ if : ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
8000
179
179
run : pip install gmpy2
180
180
- name : Install build dependencies
181
181
run : |
@@ -200,6 +200,29 @@ jobs:
200
200
- name : Run unit tests
201
201
if : ${{ matrix.tox-env }}
202
202
run : tox -e ${{ matrix.tox-env }}
203
+ - name : instrumental test coverage on PR
204
+ if : ${{ contains(matrix.opt-deps, 'instrumental') && github.event.pull_request }}
205
+ env :
206
+ BASE_REF : ${{ github.event.pull_request.base.ref }}
207
+ run : |
208
+ git fetch origin $BASE_REF
209
+ MERGE_BASE=$(git merge-base origin/$BASE_REF HEAD)
210
+ echo "MERGE_BASE:" $MERGE_BASE
211
+ git checkout $MERGE_BASE
212
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa/test*.py
213
+ instrumental -f .instrumental.cov -s
214
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py --save .diff-instrumental
215
+ git checkout $GITHUB_SHA
216
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa/test*.py
217
+ instrumental -f .instrumental.cov -sr
218
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py --read .diff-instrumental --fail-under 70 --max-difference -0.1
219
+ - name : instrumental test coverage on push
220
+ if : ${{ contains(matrix.opt-deps, 'instrumental') && !github.event.pull_request }}
221
+ run : |
222
+ instrumental -t ecdsa -i 'test.*|.*_version|.*_compat' `which pytest` src/ecdsa
223
+ instrumental -f .instrumental.cov -s
224
+ # just log the values when merging
225
+ instrumental -f .instrumental.cov -s | python diff-instrumental.py
203
226
- name : Publish coverage to Coveralls
204
227
if : ${{ !matrix.opt-deps && matrix.tox-env != 'codechecks' }}
205
228
env :
0 commit comments