-
Notifications
You must be signed in to change notification settings - Fork 46
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1290 from egbertbouman/coverage
Added workflow for generating code coverage reports
- Loading branch information
Showing
4 changed files
with
88 additions
and
4 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
name: 'Generate coverage report' | ||
inputs: | ||
html_report_name: | ||
description: 'Artifact name for storing HTML coverage report. When omitted no report is stored.' | ||
required: false | ||
runs: | ||
using: "composite" | ||
steps: | ||
- name: Generate coverage report | ||
shell: bash | ||
run: | | ||
pip install coverage | ||
python create_test_coverage_report.py | ||
echo -e "<details><summary>Coverage report</summary>\n" >> $GITHUB_STEP_SUMMARY | ||
cat coverage.md >> $GITHUB_STEP_SUMMARY | ||
echo '</details>' >> $GITHUB_STEP_SUMMARY | ||
- name: Upload coverage report | ||
if: ${{ inputs.html_report_name }} | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: ${{ inputs.html_report_name }} | ||
path: coverage/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
name: Coverage | ||
on: | ||
push: | ||
branches: | ||
- master | ||
workflow_dispatch: | ||
jobs: | ||
linux: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.7' | ||
cache: 'pip' | ||
- run: python -m pip install -r requirements.txt | ||
- uses: ./.github/actions/coverage | ||
with: | ||
html_report_name: coverage-linux | ||
windows: | ||
runs-on: windows-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.8' | ||
cache: 'pip' | ||
- uses: actions/cache/restore@v4 | ||
id: restore_cache | ||
with: | ||
path: libsodium.dll | ||
key: cache_libsodium_dll | ||
- run: python -m pip install -r requirements.txt | ||
- uses: ./.github/actions/coverage | ||
with: | ||
html_report_name: coverage-windows | ||
- uses: actions/cache/save@v4 | ||
if: steps.restore_cache.outputs.cache-hit != 'true' | ||
with: | ||
path: libsodium.dll | ||
key: cache_libsodium_dll | ||
macos: | ||
runs-on: macos-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.12' | ||
cache: 'pip' | ||
- run: python -m pip install -r requirements.txt | ||
- uses: ./.github/actions/coverage | ||
with: | ||
html_report_name: coverage-macos |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters