Use uv in github actions #513
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Tests | |
on: [push, pull_request] | |
jobs: | |
tests: | |
name: 🧪 Tests | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
python-version: ['3.9', '3.10', '3.11', '3.12', '3.13', 'pypy3.9', 'pypy3.10'] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up CPython with uv | |
if: ${{ !contains(matrix.python-version, 'pypy') }} | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up PyPy without uv | |
if: ${{ contains(matrix.python-version, 'pypy') }} | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up uv for PyPy | |
if: ${{ contains(matrix.python-version, 'pypy') }} | |
uses: astral-sh/setup-uv@v6 | |
- name: Install tox and plugins | |
run: | | |
uv pip install tox tox-gh-actions tox-uv | |
- name: Run unit tests with tox | |
run: tox | |
tests-old: | |
name: 🧪 Tests (older Python versions) | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
python-version: ['3.7', '3.8'] | |
steps: | |
- uses: actions/checkout@v5 | |
- name: Set up target Python ${{ matrix.python-version }} (for tox discovery) | |
uses: actions/setup-python@v6 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Python 3.13 (tox runner) with uv | |
uses: astral-sh/setup-uv@v6 | |
with: | |
python-version: '3.13' | |
- name: Install tox and plugins (with Python 3.13) | |
run: | | |
uv pip install tox tox-gh-actions tox-uv | |
- name: Run unit tests with tox for target | |
shell: bash | |
run: | | |
ENV="py${{ matrix.python-version }}"; ENV=${ENV/./} | |
python -m tox -e "$ENV" |