Skip to content

CI: update checkout, setup-python, setup-uv, codecov #1764

CI: update checkout, setup-python, setup-uv, codecov

CI: update checkout, setup-python, setup-uv, codecov #1764

Workflow file for this run

name: Test
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
jobs:
build:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ ubuntu-latest, windows-latest, macOS-latest ]
python-version: [ '3.12' ]
include:
- os: ubuntu-latest
python-version: '3.10'
- os: ubuntu-latest
python-version: '3.11'
- os: ubuntu-latest
python-version: '3.13'
- os: ubuntu-latest
python-version: '3.14'
- os: ubuntu-latest
python-version: '3.10'
requirements: 'minimum'
steps:
- uses: actions/checkout@v7
with:
# Ensure audformat is assigned a version,
# so we can install audb as a dependency
# https://github.com/astral-sh/uv/issues/8148#issuecomment-2408639333
fetch-depth: 0
fetch-tags: true
- name: Cache emodb
uses: actions/cache@v6
with:
path: emodb-src
key: emodb-src
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v7
with:
python-version: ${{ matrix.python-version }}
- name: Install uv
uses: astral-sh/setup-uv@v9.0.0
- name: Prepare Ubuntu
run: |
sudo apt-get update
sudo apt-get install --no-install-recommends --yes libsndfile1
if: matrix.os == 'ubuntu-latest'
- name: Sync Python environment
run: uv sync
- name: List installed Python packages
run: uv pip list
- name: Downgrade to minimum dependencies
run: |
pip install "audeer==2.0.0"
pip install "audiofile==0.4.0"
pip install "numpy<2.0.0"
pip install "pandas==2.1.0"
pip install "pyarrow==10.0.1"
pip install "pyyaml==6.0.1"
# need to use an audb version in the test,
# that supports audeer==2.0.0
pip install "audb==1.7.4"
if: matrix.requirements == 'minimum'
- name: Test with pytest
run: uv run pytest
- name: Upload coverage to Codecov
uses: codecov/codecov-action@v7
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
if: matrix.os == 'ubuntu-latest' && matrix.python-version == '3.10'