Skip to content

Commit eb10654

Browse files
committed
Use uv in GitHub Actions.
Fixes #289. It does not plainly use the things suggested in the blog post referenced in #289 but the successor provided by uv itself.
1 parent faa4ee8 commit eb10654

File tree

1 file changed

+11
-23
lines changed

1 file changed

+11
-23
lines changed

src/zope/meta/default/tests.yml.j2

Lines changed: 11 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -92,26 +92,15 @@ jobs:
9292
- uses: actions/checkout@v4
9393
with:
9494
persist-credentials: false
95-
- name: Set up Python
96-
uses: actions/setup-python@v5
95+
- name: Install uv + caching
96+
uses: astral-sh/setup-uv@v5
9797
with:
98-
python-version: ${{ matrix.config[0] }}
99-
allow-prereleases: true
100-
- name: Pip cache
101-
uses: actions/cache@v4
102-
with:
103-
path: ~/.cache/pip
104-
key: ${{ runner.os }}-pip-${{ matrix.config[0] }}-${{ hashFiles('setup.*', 'tox.ini') }}
105-
restore-keys: |
106-
${{ runner.os }}-pip-${{ matrix.config[0] }}-
107-
${{ runner.os }}-pip-
108-
- name: Install dependencies
109-
run: |
110-
python -m pip install --upgrade pip
111-
pip install tox
112-
{% for line in gha_additional_install %}
113-
%(line)s
114-
{% endfor %}
98+
enable-cache: true
99+
cache-dependency-glob: |
100+
setup.*
101+
tox.ini
102+
python-version: ${{ matrix.matrix.config[0] }}
103+
github-token: ${{ secrets.GITHUB_TOKEN }}
115104
- name: Test
116105
if: ${{ !startsWith(runner.os, 'Mac') }}
117106
{% if gha_test_environment %}
@@ -126,7 +115,7 @@ jobs:
126115
%(line)s
127116
{% endfor %}
128117
{% else %}
129-
run: tox -e ${{ matrix.config[1] }}
118+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}
130119
{% endif %}
131120
- name: Test (macOS)
132121
if: ${{ startsWith(runner.os, 'Mac') }}
@@ -136,11 +125,10 @@ jobs:
136125
%(line)s
137126
{% endfor %}
138127
{% endif %}
139-
run: tox -e ${{ matrix.config[1] }}-universal2
128+
run: uvx --with tox-uv tox -e ${{ matrix.config[1] }}-universal2
140129
- name: Coverage
141130
if: matrix.config[1] == 'coverage'
142131
run: |
143-
pip install coveralls
144-
coveralls --service=github
132+
uvx coveralls --service=github
145133
env:
146134
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

0 commit comments

Comments
 (0)