18
18
# cron every week on monday
19
19
- cron : " 0 0 * * 1"
20
20
21
+ env :
22
+ UV_SYSTEM_PYTHON : 1
23
+
21
24
jobs :
22
25
test :
23
26
runs-on : ubuntu-latest
@@ -34,33 +37,34 @@ jobs:
34
37
- pydantic-v1
35
38
- pydantic-v2
36
39
fail-fast : false
37
-
38
40
steps :
39
41
- uses : actions/checkout@v4
40
42
- name : Set up Python
41
43
uses : actions/setup-python@v5
42
44
with :
43
45
python-version : ${{ matrix.python-version }}
46
+ - name : Setup uv
47
+ uses : astral-sh/setup-uv@v3
48
+ with :
49
+ version : " 0.4.15"
50
+ enable-cache : true
51
+ cache-dependency-glob : |
52
+ requirements**.txt
53
+ pyproject.toml
44
54
# Allow debugging with tmate
45
55
- name : Setup tmate session
46
56
uses : mxschmitt/action-tmate@v3
47
57
if : ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.debug_enabled == 'true' }}
48
58
with :
49
59
limit-access-to-actor : true
50
- - uses : actions/cache@v4
51
- id : cache
52
- with :
53
- path : ${{ env.pythonLocation }}
54
- key : ${{ runner.os }}-python-${{ env.pythonLocation }}-${{ hashFiles('pyproject.toml', 'requirements-tests.txt') }}-v01
55
60
- name : Install Dependencies
56
- if : steps.cache.outputs.cache-hit != 'true'
57
- run : pip install -r requirements-tests.txt
61
+ run : uv pip install -r requirements-tests.txt
58
62
- name : Install Pydantic v1
59
63
if : matrix.pydantic-version == 'pydantic-v1'
60
- run : pip install --upgrade "pydantic>=1.10.0,<2.0.0"
64
+ run : uv pip install --upgrade "pydantic>=1.10.0,<2.0.0"
61
65
- name : Install Pydantic v2
62
66
if : matrix.pydantic-version == 'pydantic-v2'
63
- run : pip install --upgrade "pydantic>=2.0.2,<3.0.0" "typing-extensions==4.6.1"
67
+ run : uv pip install --upgrade "pydantic>=2.0.2,<3.0.0" "typing-extensions==4.6.1"
64
68
- name : Lint
65
69
# Do not run on Python 3.7 as mypy behaves differently
66
70
if : matrix.python-version != '3.7' && matrix.pydantic-version == 'pydantic-v2'
@@ -82,28 +86,31 @@ jobs:
82
86
needs :
83
87
- test
84
88
runs-on : ubuntu-latest
85
-
86
89
steps :
87
90
- uses : actions/checkout@v4
88
-
89
91
- uses : actions/setup-python@v5
90
92
with :
91
93
python-version : ' 3.12'
92
-
94
+ - name : Setup uv
95
+ uses : astral-sh/setup-uv@v3
96
+ with :
97
+ version : " 0.4.15"
98
+ enable-cache : true
99
+ cache-dependency-glob : |
100
+ requirements**.txt
101
+ pyproject.toml
93
102
- name : Get coverage files
94
103
uses : actions/download-artifact@v4
95
104
with :
96
105
pattern : coverage-*
97
106
path : coverage
98
107
merge-multiple : true
99
-
100
- - run : pip install coverage[toml]
101
-
108
+ - name : Install Dependencies
109
+ run : uv pip install -r requirements-tests.txt
102
110
- run : ls -la coverage
103
111
- run : coverage combine coverage
104
112
- run : coverage report
105
113
- run : coverage html --title "Coverage for ${{ github.sha }}"
106
-
107
114
- name : Store coverage HTML
108
115
uses : actions/upload-artifact@v4
109
116
with :
0 commit comments