-
Notifications
You must be signed in to change notification settings - Fork 0
112 lines (95 loc) · 3.08 KB
/
python-package.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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
name: Coverage CI
on: [push, pull_request]
jobs:
code-quality:
runs-on: ubuntu-latest
continue-on-error: true
name: Analyze the repo with CodeSee
steps:
- uses: Codesee-io/codesee-action@v2
with:
codesee-token: ${{ secrets.CODESEE_ARCH_DIAG_API_TOKEN }}
codesee-url: https://app.codesee.io
lint:
runs-on: ubuntu-latest
strategy:
max-parallel: 3
fail-fast: false
matrix:
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13']
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: "pip"
- name: "Install and run pre-commit via tox"
run: |
python -m pip install tox==3.27.1 tox-gh-actions
python -m tox -vv
documentation-linkage:
runs-on: ubuntu-latest
steps:
- uses: readthedocs/actions/preview@v1
with:
project-slug: "readthedocs-preview"
tests:
runs-on: ubuntu-latest
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 test results to Codecov
if: ${{ !cancelled() }}
uses: codecov/test-results-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}