Added a momentary h-bridge switch #6
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
name: Coverage | |
on: | |
push: | |
branches: [ main ] | |
jobs: | |
coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: | | |
3.10 | |
3.11 | |
- name: Add .local path | |
run: | | |
echo "PATH=$HOME/.local/bin:$PATH" >> $GITHUB_ENV | |
echo "PIPX_HOME=$HOME/.local/pipx" >> $GITHUB_ENV | |
echo "PIPX_BIN_DIR=$HOME/.local/bin" >> $GITHUB_ENV | |
- name: Install Base Dependencies | |
run: | | |
sudo apt-get install python3-venv pipx | |
pipx install hatch | |
- name: Run Tests | |
run: | | |
hatch run test:cov | |
- name: Calculate coverage | |
run: | | |
hatch run test: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.7.0 | |
with: | |
auth: ${{ secrets.GIST_TOKEN }} | |
gistID: 5d987fef5ad47e17d68138644e5331b5 | |
filename: coverage.json | |
label: Coverage | |
message: ${{ env.total }}% | |
minColorRange: 50 | |
maxColorRange: 90 | |
valColorRange: ${{ env.total }} |