Skip to content

make sure addgains is specified before masking them #24

make sure addgains is specified before masking them

make sure addgains is specified before masking them #24

name: Run unit tests
on:
push:
branches:
- main
- dev
pull_request:
branches:
- main
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
python-version: ["3.11"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip setuptools wheel
- name: Test with tox
run: |
pip install tox coverage
tox -e py
- name: Upload coverage data
uses: actions/upload-artifact@v3
with:
name: covdata
path: .coverage.*
- name: Download coverage data
uses: actions/download-artifact@v3
with:
name: covdata
- name: Combine
run: |
python -m coverage combine
# Report and write to summary.
python -m coverage report
python -m coverage report | sed 's/^/ /' >> $GITHUB_STEP_SUMMARY
python -m coverage json
export TOTAL=$(python -c "import json;print(json.load(open('coverage.json'))['totals']['percent_covered_display'])")
echo "total=$TOTAL" >> $GITHUB_ENV
echo "### Total coverage: ${TOTAL}%" >> $GITHUB_STEP_SUMMARY
- name: Make badge
uses: schneegans/dynamic-badges-action@v1.6.0
with:
auth: ${{ secrets.GIST_TOKEN }}
gistID: de229c48256d967a1cb8b29dbf575602
filename: covbadge.json
label: code coverage
message: ${{ env.total }}%
minColorRange: 50
maxColorRange: 90
valColorRange: ${{ env.total }}