Skip to content

Commit 480c6c5

Browse files
committed
Update CI workflow.
1 parent 8688be1 commit 480c6c5

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,9 @@ on:
66
branches:
77
- "main"
88

9+
env:
10+
PYTHON_VERSION: 3.11
11+
912
jobs:
1013
test:
1114
name: Run tests & display coverage
@@ -20,11 +23,26 @@ jobs:
2023
contents: write
2124
steps:
2225
- uses: actions/checkout@v4
26+
with:
27+
fetch-depth: 1
2328

24-
- name: Install everything, run the tests, produce the .coverage file
29+
- name: Install Poetry
2530
run: |
26-
run coverage run -m pytest
27-
run coverage xml
31+
pipx install poetry
32+
poetry config virtualenvs.path ~/.virtualenvs${{ env.PYTHON_VERSION }}
33+
34+
- name: Set up Python ${{ env.PYTHON_VERSION }}
35+
uses: actions/setup-python@v3
36+
with:
37+
python-version: ${{ env.PYTHON_VERSION }}
38+
cache: "poetry"
39+
40+
- name: Install dependencies
41+
run: |
42+
poetry install -E minify
43+
44+
- name: Produce the .coverage file
45+
run: poetry run coverage run -m pytest
2846

2947
- name: Coverage comment
3048
id: coverage_comment

pyproject.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,10 @@ disable_error_code = ["empty-body"]
174174
module = "decorator"
175175
ignore_missing_imports = true
176176

177+
[tool.coverage.run]
178+
branch = true
179+
relative_files = true
180+
177181
[build-system]
178182
requires = ["poetry-core>=1.0.0"]
179183
build-backend = "poetry.core.masonry.api"

0 commit comments

Comments
 (0)