Skip to content

Commit 8c2531f

Browse files
committed
more realistic mutation rate and update badge only on merge
1 parent a4a8acd commit 8c2531f

File tree

1 file changed

+18
-6
lines changed

1 file changed

+18
-6
lines changed

.github/workflows/ci.yml

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -268,7 +268,7 @@ jobs:
268268
- name: Install mutation testing dependencies
269269
if: ${{ matrix.mutation == 'true' }}
270270
run: |
271-
pip install cosmic-ray
271+
pip install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
272272
- name: Display installed python package versions
273273
run: pip list
274274
- name: Test native speed
@@ -372,6 +372,9 @@ jobs:
372372
373373
mutation-prepare:
374374
name: Prepare job files for the mutation runners
375+
# use runner minutes on mutation testing only after the PR passed basic
376+
# testing
377+
needs: coveralls
375378
runs-on: ubuntu-latest
376379
steps:
377380
- uses: actions/checkout@v2
@@ -386,7 +389,7 @@ jobs:
386389
key: sessions-${{ github.sha }}
387390
- name: Install cosmic-ray
388391
run: |
389-
pip3 install cosmic-ray
392+
pip3 install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
390393
- name: Install dependencies
391394
run: |
392395
sudo apt-get install -y sqlite3
@@ -461,7 +464,7 @@ jobs:
461464
- name: Install build dependencies
462465
run: |
463466
pip install -r build-requirements.txt
464-
pip install cosmic-ray
467+
pip install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
465468
- name: Run mutation testing
466469
run: |
467470
cp sessions/session-${{ matrix.name }}.sqlite session.sqlite
@@ -608,7 +611,7 @@ jobs:
608611
key: sessions-${{ github.sha }}-19-done
609612
- name: Install cosmic-ray
610613
run: |
611-
pip3 install cosmic-ray
614+
pip3 install https://github.com/tomato42/cosmic-ray/archive/random-order.zip
612615
- name: Install dependencies
613616
run: |
614617
sudo apt-get install -y sqlite3
@@ -621,13 +624,20 @@ jobs:
621624
- name: Report executed
622625
run: |
623626
cr-report session.sqlite | tail -n 3
624-
- name: Log survival estimate
625-
run: cr-rate --estimate --fail-over 32 --confidence 99.9 session.sqlite || true
627+
- name: Generate html report
628+
run: |
629+
cr-html session.sqlite > cosmic-ray.html
630+
- name: Archive mutation testing results
631+
uses: actions/upload-artifact@v3
632+
with:
633+
name: mutation-coverage-report
634+
path: cosmic-ray.html
626635
- name: Get mutation score
627636
run: |
628637
echo "print(100-$(cr-rate session.sqlite))" > print-score.py
629638
echo "MUT_SCORE=$(python print-score.py)" >> $GITHUB_ENV
630639
- name: Create mutation score badge
640+
if: ${{ !github.event.pull_request }}
631641
uses: schneegans/dynamic-badges-action@v1.4.0
632642
with:
633643
auth: ${{ secrets.GIST_SECRET }}
@@ -638,3 +648,5 @@ jobs:
638648
valColorRange: ${{ env.MUT_SCORE }}
639649
maxColorRange: 100
640650
minColorRange: 0
651+
- name: Check survival estimate
652+
run: cr-rate --estimate --fail-over 32 --confidence 99.9 session.sqlite

0 commit comments

Comments
 (0)