Skip to content

Commit

Permalink
show coverage information
Browse files Browse the repository at this point in the history
  • Loading branch information
butterunderflow committed Aug 4, 2024
1 parent 7122a68 commit 5854450
Showing 1 changed file with 24 additions and 1 deletion.
25 changes: 24 additions & 1 deletion .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,10 @@ on:
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:

# We need to comment coverage information
permissions:
pull-requests: write

# Make sure there's only one ci triggerd for a non-master branch
concurrency:
group: ${{ github.ref }}
Expand Down Expand Up @@ -61,11 +65,30 @@ jobs:
- name: Run tests
run: opam exec -- dune runtest

- name: Get test with coverage instrumentation
- name: Test with coverage instrumentation
run: |
mkdir $BISECT_DIR
opam exec -- dune runtest --instrument-with bisect_ppx --force
opam exec -- bisect-ppx-report summary --per-file --coverage-path=$BISECT_DIR >> $GITHUB_STEP_SUMMARY
opam exec -- bisect-ppx-report cobertura cobertura.xml --coverage-path=$BISECT_DIR
env:
BISECT_DIR: ${{ runner.temp }}/_coverage
BISECT_FILE: ${{ runner.temp }}/_coverage/bisect_data

- name: Code Coverage Summary
uses: irongut/[email protected]
with:
filename: cobertura.xml
badge: true
format: markdown

- uses: jwalton/gh-find-current-pr@v1
id: finder
- name: Add Coverage PR Comment
uses: marocchino/sticky-pull-request-comment@v2
if: github.event_name == 'pull_request'
with:
number: ${{ steps.finder.outputs.pr }}
hide: true
hide_classify: "OUTDATED"
path: code-coverage-results.md

0 comments on commit 5854450

Please sign in to comment.