Skip to content

Fix CI errors casued by different versions of uv #3533

Fix CI errors casued by different versions of uv

Fix CI errors casued by different versions of uv #3533

Workflow file for this run

name: Tests
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
schedule:
- cron: "0 4 * * *"
permissions:
contents: read
env:
FORCE_COLOR: 1
jobs:
pytest:
name: Unit tests
strategy:
matrix:
os: [ubuntu-latest, macos-latest, windows-latest]
python: ["3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
runs-on: ${{ matrix.os }}
env:
OS: ${{ matrix.os }}
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install the latest version of uv
uses: astral-sh/setup-uv@v7
with:
# Bump this suffix to invalidate stale UV_CACHE_DIR entries that a
# newer uv binary cannot deserialize on macOS/Windows runners
# (error: "Failed to deserialize cache entry … invalid ID").
cache-suffix: v2
- name: Install tox
run: uv tool install --python ${{ matrix.python }} --with tox-uv tox
- name: Add local bin to path on Windows
if: runner.os == 'Windows'
run: echo "C:/Users/runneradmin/.local/bin" >> $GITHUB_PATH
shell: bash
- name: Setup test suite
run: tox run -v --notest --skip-missing-interpreters false -e ${{ matrix.python }}
# Run all tests on schedule, but only non-slow tests on push.
# Use the coverage env on ubuntu/3.14 to generate coverage.xml for Codecov.
- name: Run pytest
run: |
if [ "${{ matrix.os }}" == "ubuntu-latest" ] && [ "${{ matrix.python }}" == "3.14" ]; then
TOX_ENV=coverage
else
TOX_ENV=pytest
fi
if [ "${{ github.event_name }}" == "schedule" ]; then
tox -e $TOX_ENV
else
tox -e $TOX_ENV -- -m "not slow"
fi
shell: bash # this wouldn't work on Powershell
- name: Upload coverage reports to Codecov
if: ${{ matrix.os == 'ubuntu-latest' && matrix.python == '3.14' }}
uses: codecov/codecov-action@v6.0.0
env:
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}
cli:
name: CLI smoke tests
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v6
with:
fetch-depth: 0
- name: Install uv
uses: astral-sh/setup-uv@v7
with:
cache-suffix: v2
- name: Test transforms CLI tool
run: uv run -- tiotr --help
- name: Test info CLI tool
run: uv run -- tiohd --help