Brunolnetto/uv #554
Workflow file for this run
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 CI | |
on: [push, pull_request] | |
jobs: | |
poetry: | |
runs-on: ubuntu-20.04 | |
defaults: | |
run: | |
shell: bash | |
strategy: | |
max-parallel: 42 | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10"] | |
steps: | |
#---------------------------------------------- | |
# check-out repo and set-up python | |
#---------------------------------------------- | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up python | |
id: setup-python | |
uses: actions/setup-python@v4 | |
with: | |
python-version: ${{ matrix.python-version }} | |
#---------------------------------------------- | |
# install & configure uv | |
#---------------------------------------------- | |
- name: Install uv | |
uses: astral-sh/setup-uv@v3 | |
with: | |
# Install a specific version of uv. | |
version: "0.5.1" | |
- name: Set up Python | |
run: uv python install | |
- name: Install the project | |
run: uv sync --all-extras --dev | |
#---------------------------------------------- | |
# install dependencies if cache does not exist | |
#---------------------------------------------- | |
- name: Define a cache dependency glob | |
uses: astral-sh/setup-uv@v3 | |
with: | |
enable-cache: true | |
cache-dependency-glob: "uv.lock" | |
- name: Run tests | |
# For example, using `pytest` | |
run: uv run pytest tests | |
#---------------------------------------------- | |
# Test coverage | |
#---------------------------------------------- | |
- name: Run tests and generate coverage | |
run: | | |
uv run pytest --cov=eule tests/ | |
# Uncomment when achieve sufficient coverage threshold | |
uv run coverage report -m | |
#---------------------------------------------- | |
# Update codecov coverage | |
#---------------------------------------------- | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v3 |