-
Notifications
You must be signed in to change notification settings - Fork 357
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
d3a07f4
commit e825b35
Showing
1 changed file
with
35 additions
and
22 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 |
---|---|---|
@@ -1,26 +1,39 @@ | ||
name: "Code Coverage" | ||
|
||
on: [push, pull_request] | ||
on: [ push, pull_request ] | ||
|
||
jobs: | ||
coverage: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Set up Python | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.11' | ||
- name: Install dependencies | ||
run: | | ||
pip install -r requirements.txt | ||
- name: Run pytest with coverage | ||
run: | | ||
pytest --cov=./ --cov-report=xml | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./coverage.xml | ||
flags: unittests | ||
name: codecov-umbrella | ||
fail_ci_if_error: false | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [ "3.11.3" ] | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- uses: eifinger/setup-rye@v3 | ||
id: setup-rye | ||
with: | ||
enable-cache: true | ||
cache-prefix: ${{ matrix.python-version }} | ||
- name: Pin python-version ${{ matrix.python-version }} | ||
if: steps.setup-rye.outputs.cache-hit != 'true' | ||
run: rye pin ${{ matrix.python-version }} | ||
- name: Install dependencies | ||
if: steps.setup-rye.outputs.cache-hit != 'true' | ||
run: | | ||
rye sync --no-lock | ||
- name: Cache pre-commit | ||
uses: actions/cache@ab5e6d0c87105b4c9c2047343972218f562e4319 # v4.0.1 | ||
with: | ||
path: ~/.cache/pre-commit | ||
key: pre-commit-|${{ matrix.python-version }}|${{ hashFiles('.pre-commit-config.yaml') }} | ||
- name: Lint | ||
run: | | ||
rye run pre-commit run --all-files | ||
- name: Test | ||
run: | | ||
rye run pytest --cov=src --cov-report=html | ||
- name: Upload coverage to Codecov | ||
uses: codecov/codecov-action@v1 | ||
with: | ||
file: ./htmlcov/index.html |