Skip to content

Test coverage badge #20

Test coverage badge

Test coverage badge #20

Workflow file for this run

name: Test Coverage
on: [pull_request]
jobs:
coverage:
runs-on: windows-latest
steps:
- uses: actions/checkout@v3
- name: Set up Python 3.11
uses: actions/setup-python@v4
with:
python-version: "3.11"
- name: Install dependencies
run: |
C:\Miniconda\condabin\conda.bat update -n base -c defaults conda
C:\Miniconda\condabin\conda.bat config --add channels conda-forge
C:\Miniconda\condabin\conda.bat config --set channel_priority strict
C:\Miniconda\condabin\conda.bat env update --file environment.yaml --name base
C:\Miniconda\condabin\conda.bat activate base
C:\Miniconda\condabin\conda.bat install coverage
C:\Miniconda\condabin\conda.bat init powershell
- id: check-coverage
name: Check coverage
run: |
# Activate the testenv environment
C:\Miniconda\condabin\conda.bat activate base
C:\Miniconda\condabin\conda.bat list
coverage run -m pytest
echo "P_COV=35" >> "$GITHUB_OUTPUT"
- name: Create badge
env:
P_COV: ${{ steps.check-coverage.outputs.P_COV }}
uses: schneegans/dynamic-badges-action@v1.7.0
with:
auth: ${{ secrets.TEST_COVERAGE_GIST }}
gistID: 8ec74eae558f3a7793622f6469064b73
filename: test_coverage_badge.json
label: Test coverage
message: "is $P_COV"
valColorRange: ${{ P_COV }}

Check failure on line 42 in .github/workflows/TestCoverage.yml

View workflow run for this annotation

GitHub Actions / Test Coverage

Invalid workflow file

The workflow is not valid. .github/workflows/TestCoverage.yml (Line: 42, Col: 26): Unrecognized named-value: 'P_COV'. Located at position 1 within expression: P_COV
maxColorRange: 100
minColorRange: 0