1
1
name : Tests
2
2
3
3
on :
4
- push :
5
- branches :
6
- - master
7
4
pull_request :
8
- branches :
9
- - master
5
+ types : [opened, reopened, synchronize]
6
+
7
+ concurrency :
8
+ group : ${{ github.workflow }}-${{ github.ref }}
9
+ cancel-in-progress : true
10
10
11
11
jobs :
12
12
tests :
17
17
matrix :
18
18
include :
19
19
- { python: "3.12", os: "ubuntu-latest", session: "pre-commit" }
20
- - { python: "3.12", os: "ubuntu-latest", session: "mypy" }
21
- - { python: "3.11", os: "ubuntu-latest", session: "mypy" }
22
- - { python: "3.10", os: "ubuntu-latest", session: "mypy" }
20
+ # - { python: "3.12", os: "ubuntu-latest", session: "mypy" }
21
+ # - { python: "3.11", os: "ubuntu-latest", session: "mypy" }
22
+ # - { python: "3.10", os: "ubuntu-latest", session: "mypy" }
23
23
- { python: "3.12", os: "ubuntu-latest", session: "tests" }
24
24
- { python: "3.11", os: "ubuntu-latest", session: "tests" }
25
25
- { python: "3.10", os: "ubuntu-latest", session: "tests" }
@@ -34,135 +34,26 @@ jobs:
34
34
- { python: "3.10", os: "macos-13", session: "tests" }
35
35
- { python: "3.12", os: "ubuntu-latest", session: "docs-build" }
36
36
37
- env :
38
- NOXSESSION : ${{ matrix.session }}
39
- FORCE_COLOR : " 1"
40
- PRE_COMMIT_COLOR : " always"
41
-
42
37
steps :
43
- - name : Check out the repository
38
+ - name : Check out the repo
44
39
uses : actions/checkout@v4
45
40
46
- - name : Set up Python ${{ matrix.python }}
47
- uses : actions /setup-python@v5
41
+ - name : Install a specific version of uv
42
+ uses : astral-sh /setup-uv@v3
48
43
with :
49
- python-version : ${{ matrix.python }}
50
-
51
- - name : Upgrade pip
52
- run : |
53
- pip install --constraint=.github/workflows/constraints.txt pip
54
- pip --version
55
-
56
- - name : Upgrade pip in virtual environments
57
- shell : python
58
- run : |
59
- import os
60
- import pip
44
+ version : " 0.4.24"
45
+ enable-cache : true
61
46
62
- with open(os.environ["GITHUB_ENV"], mode="a") as io:
63
- print(f"VIRTUALENV_PIP={pip.__version__}", file=io)
47
+ - name : Install python ${{ matrix.python }} using uv
48
+ run : uv python install ${{ matrix.python }}
64
49
65
- - name : Install Poetry
66
- run : |
67
- pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
68
- poetry --version
69
-
70
- - name : Install Nox
71
- run : |
72
- pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
73
- pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
74
- nox --version
50
+ - name : Install dependencies # TODO: which extras to install?
51
+ run : uv sync
75
52
76
53
- name : Install pandoc
77
54
if : matrix.session == 'docs-build'
78
55
uses : pandoc/actions/setup@v1
79
56
80
- - name : Compute pre-commit cache key
81
- if : matrix.session == 'pre-commit'
82
- id : pre-commit-cache
83
- shell : python
84
- run : |
85
- import hashlib
86
- import sys
87
-
88
- python = "py{}.{}".format(*sys.version_info[:2])
89
- payload = sys.version.encode() + sys.executable.encode()
90
- digest = hashlib.sha256(payload).hexdigest()
91
- result = "${{ runner.os }}-{}-{}-pre-commit".format(python, digest[:8])
92
-
93
- print("::set-output name=result::{}".format(result))
94
-
95
- - name : Restore pre-commit cache
96
- uses : actions/cache@v4
97
- if : matrix.session == 'pre-commit'
98
- with :
99
- path : ~/.cache/pre-commit
100
- key : ${{ steps.pre-commit-cache.outputs.result }}-${{ hashFiles('.pre-commit-config.yaml') }}
101
- restore-keys : |
102
- ${{ steps.pre-commit-cache.outputs.result }}-
103
-
104
- - name : Run Nox
105
- run : |
106
- nox --python=${{ matrix.python }}
107
-
108
- - name : Upload coverage data
109
- if : always() && matrix.session == 'tests'
110
- uses : actions/upload-artifact@v4
111
- with :
112
- name : coverage-data-${{ matrix.os }}-${{ matrix.python }}
113
- include-hidden-files : true
114
- path : " .coverage.*"
115
-
116
- - name : Upload documentation
117
- if : matrix.session == 'docs-build'
118
- uses : actions/upload-artifact@v4
119
- with :
120
- name : docs
121
- path : docs/_build
122
-
123
- coverage :
124
- runs-on : ubuntu-latest
125
- needs : tests
126
- steps :
127
- - name : Check out the repository
128
- uses : actions/checkout@v4
129
-
130
- - name : Set up Python
131
- uses : actions/setup-python@v5
132
- with :
133
- python-version : " 3.12"
134
-
135
- - name : Upgrade pip
136
- run : |
137
- pip install --constraint=.github/workflows/constraints.txt pip
138
- pip --version
139
-
140
- - name : Install Poetry
141
- run : |
142
- pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt poetry
143
- poetry --version
144
-
145
- - name : Install Nox
146
- run : |
147
- pipx install --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox
148
- pipx inject --pip-args=--constraint=${{ github.workspace }}/.github/workflows/constraints.txt nox nox-poetry
149
- nox --version
150
-
151
- - name : Download coverage data
152
- uses : actions/download-artifact@v4
153
- with :
154
- pattern : coverage-data-*
155
- merge-multiple : true
156
-
157
- - name : Combine coverage data and display human readable report
158
- run : |
159
- nox --session=coverage
160
-
161
- - name : Create coverage report
162
- run : |
163
- nox --session=coverage -- xml -i
164
-
165
- - name : Upload coverage report
166
- uses : codecov/codecov-action@v4
167
- with :
168
- token : ${{ secrets.CODECOV_TOKEN }}
57
+ - name : Run pytest
58
+ if : matrix.session == 'tests'
59
+ run : uv run pytest -m 'not benchmark_suite'
0 commit comments