Skip to content

Commit

Permalink
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update build.yml to handle coverage correctly
Browse files Browse the repository at this point in the history
ibro45 committed Nov 30, 2024
1 parent f2b8595 commit b036b79
Showing 2 changed files with 18 additions and 5 deletions.
22 changes: 18 additions & 4 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -7,29 +7,35 @@ on:
pull_request:
branches:
- main


permissions:
contents: write

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.10", "3.11"]
fail-fast: false

steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2.2.2
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}

- name: Install poetry
run: make setup

- name: Set up cache
uses: actions/cache@v2.1.6
uses: actions/cache@v3
with:
path: .venv
key: venv-${{ matrix.python-version }}-${{ hashFiles('pyproject.toml') }}-${{ hashFiles('poetry.lock') }}
restore-keys: |
venv-${{ matrix.python-version }}-
- name: Install dependencies
run: |
@@ -51,3 +57,11 @@ jobs:
poetry install --with tests
make test
- name: Commit coverage badge
if: github.ref == 'refs/heads/main' && success()
run: |
git config --local user.email "github-actions[bot]@users.noreply.github.com"
git config --local user.name "github-actions[bot]"
git add assets/images/coverage.svg
git commit -m "Update coverage badge" || echo "No changes to commit"
git push
Loading

0 comments on commit b036b79

Please sign in to comment.