-
Notifications
You must be signed in to change notification settings - Fork 0
70 lines (60 loc) · 2.03 KB
/
test-coverage.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
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