Infra: Lint and test via uv (#4102)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
This commit is contained in:
Hugo van Kemenade 2024-11-02 23:28:24 +02:00 committed by GitHub
parent bd7b43a2ac
commit 85c1106c05
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 15 additions and 18 deletions

View File

@ -20,16 +20,18 @@ jobs:
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python 3 - name: Set up Python 3
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: "3.x" python-version: "3.x"
cache: pip
- name: Run pre-commit hooks - name: Run pre-commit hooks
uses: pre-commit/action@v3.0.1 uses: tox-dev/action-pre-commit-uv@v1
- name: Check spelling - name: Check spelling
uses: pre-commit/action@v3.0.1 uses: tox-dev/action-pre-commit-uv@v1
with: with:
extra_args: --all-files --hook-stage manual codespell || true extra_args: --all-files --hook-stage manual codespell || true

View File

@ -39,32 +39,27 @@ jobs:
- "windows-latest" - "windows-latest"
- "macos-latest" - "macos-latest"
- "ubuntu-latest" - "ubuntu-latest"
# Python 3.9 is on macos-13 but not macos-latest (macos-14-arm64)
# https://github.com/actions/setup-python/issues/696#issuecomment-1637587760
exclude:
- { python-version: "3.9", os: "macos-latest" }
include:
- { python-version: "3.9", os: "macos-13" }
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
with:
persist-credentials: false
- name: Set up Python ${{ matrix.python-version }} - name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5 uses: actions/setup-python@v5
with: with:
python-version: ${{ matrix.python-version }} python-version: ${{ matrix.python-version }}
cache: pip
allow-prereleases: true allow-prereleases: true
- name: Install dependencies - name: Install uv
run: | uses: hynek/setup-cached-uv@v2
python -m pip install -U pip with:
python -m pip install -U wheel cache-dependency-path: |
python -m pip install -U tox requirements.txt
- name: Run tests - name: Run tests with tox
run: | run: |
tox -e py -- -v --cov-report term uvx --with tox-uv tox -e py -- -v --cov-report term
- name: Upload coverage - name: Upload coverage
uses: codecov/codecov-action@v4 uses: codecov/codecov-action@v4