8000 Merge pull request #245 from tlsfuzzer/more-tests · tlsfuzzer/python-ecdsa@8dea392 · GitHub
[go: up one dir, main page]

Skip to content

Commit 8dea392

Browse files
authored
Merge pull request #245 from tlsfuzzer/more-tests
More tests
2 parents 88e671d + 212da42 commit 8dea392

File tree

1 file changed

+36
-4
lines changed

1 file changed

+36
-4
lines changed

.github/workflows/ci.yml

Lines changed: 36 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,16 @@ jobs:
166166
pip list
167167
pip install setuptools==28.8.0 wheel==0.30.0a0
168168
- name: Install instrumental
169-
if: ${{ contains(matrix.tox-env, 'instrumental') }}
169+
if: ${{ contains(matrix.opt-deps, 'instrumental') }}
170170
run: pip install instrumental
171171
- name: Install gmpy
172-
if: ${{ contains(matrix.tox-env, 'gmpy') }}
172+
if: ${{ contains(matrix.tox-env, 'gmpyp') }}
173173
run: pip install gmpy
174174
- name: Install gmpy2 dependencies
175-
if: ${{ contains(matrix.tox-env, 'gmpy2') }}
175+
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
176176
run: sudo apt-get install -y libmpfr-dev libmpc-dev
177177
- name: Install gmpy2
178-
if: ${{ contains(matrix.tox-env, 'gmpy2') }}
178+
if: ${{ contains(matrix.tox-env, 'gmpy2') || contains(matrix.tox-env, 'instrumental') }}
179179
run: pip install gmpy2
180180
- name: Install build dependencies
181181
run: |
@@ -188,9 +188,41 @@ jobs:
188188
fi
189189
- name: Display installed python package versions
190190
run: pip list
191+
- name: Test native speed
192+
if: ${{ !contains(matrix.tox-env, 'gmpy') }}
193+
run: tox -e speed
194+
- name: Test speed with gmpy
195+
if: ${{ contains(matrix.tox-env, 'gmpyp') }}
196+
run: tox -e speedgmpy
197+
- name: Test speed with gmpy2
198+
if: ${{ contains(matrix.tox-env, 'gmpy2') }}
199+
run: tox -e speedgmpy2
191200
- name: Run unit tests
192201
if: ${{ matrix.tox-env }}
193202
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
194226
- name: Publish coverage to Coveralls
195227
if: ${{ !matrix.opt-deps && matrix.tox-env != 'codechecks' }}
196228
env:

0 commit comments

Comments
 (0)
0