Skip to content

Commit

Permalink
Update CI workflow.
Browse files Browse the repository at this point in the history
  • Loading branch information
adamghill committed Jul 28, 2024
1 parent 8688be1 commit 480c6c5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 3 deletions.
24 changes: 21 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
branches:
- "main"

env:
PYTHON_VERSION: 3.11

jobs:
test:
name: Run tests & display coverage
Expand All @@ -20,11 +23,26 @@ jobs:
contents: write
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 1

- name: Install everything, run the tests, produce the .coverage file
- name: Install Poetry
run: |
run coverage run -m pytest
run coverage xml
pipx install poetry
poetry config virtualenvs.path ~/.virtualenvs${{ env.PYTHON_VERSION }}
- name: Set up Python ${{ env.PYTHON_VERSION }}
uses: actions/setup-python@v3
with:
python-version: ${{ env.PYTHON_VERSION }}
cache: "poetry"

- name: Install dependencies
run: |
poetry install -E minify
- name: Produce the .coverage file
run: poetry run coverage run -m pytest

- name: Coverage comment
id: coverage_comment
Expand Down
4 changes: 4 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@ disable_error_code = ["empty-body"]
module = "decorator"
ignore_missing_imports = true

[tool.coverage.run]
branch = true
relative_files = true

[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"

0 comments on commit 480c6c5

Please sign in to comment.