chore(coverage.yml): rename job from 'tests' to 'coverage' for clarity #2
This file contains hidden or 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: Collect coverage and upload to Codecov | |
on: | |
push: | |
branches: | |
- master | |
jobs: | |
coverage: | |
runs-on: ubuntu-22.04 | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: "3.12" | |
- name: Install Poetry | |
uses: abatilo/actions-poetry@v2 | |
- name: Setup a local virtual environment | |
run: | | |
poetry config virtualenvs.create true --local | |
poetry config virtualenvs.in-project true --local | |
- uses: actions/cache@v3 | |
name: Define a cache for the virtual environment based on the dependencies lock file | |
with: | |
path: ./.venv | |
key: venv-${{ hashFiles('poetry.lock') }} | |
- name: Install dependencies | |
run: poetry install | |
- name: Run tests and collect coverage | |
run: poetry run pytest --cov --cov-report=xml | |
- name: Upload coverage raports to Codecov | |
uses: codecov/codecov-action@v4.0.1 | |
with: | |
token: ${{ secrets.CODECOV_TOKEN }} |