Skip to content

TST: migrate to official astral-sh/setup-uv action #268

TST: migrate to official astral-sh/setup-uv action

TST: migrate to official astral-sh/setup-uv action #268

Workflow file for this run

name: Build and Test
on:
push:
branches:
- main
pull_request:
workflow_dispatch:
defaults:
run:
shell: bash
jobs:
build:
strategy:
# run all tests even if e.g. image tests fail early
fail-fast: false
matrix:
os:
- ubuntu-latest
python-version:
- '3.9'
- '3.10'
- '3.11'
- '3.12'
# Test all on ubuntu, test ends on macos and windows
include:
- os: macos-latest
python-version: '3.9'
- os: windows-latest
python-version: '3.9'
- os: macos-latest
python-version: '3.12'
- os: windows-latest
python-version: '3.12'
- os: ubuntu-20.04
python-version: '3.9'
install-args: --resolution=lowest-direct
runs-on: ${{ matrix.os }}
steps:
- name: Checkout repo
uses: actions/checkout@v4
- uses: astral-sh/setup-uv@v2
with:
enable-cache: true
github-token: ${{ secrets.GITHUB_TOKEN }}
- name: Build
run: |
uv venv --python ${{ matrix.python-version }}
uv pip install --editable "." ${{ matrix.install-args }}
- run: uv pip install --requirement test_requirements.txt
- run: uv pip list
- name: Run test suite (UNIX)
if: matrix.os != 'windows-latest'
run: |
source .venv/bin/activate
pytest --color yes -ra
- name: Run test suite (Windows)
if: matrix.os == 'windows-latest'
run: |
source .venv/Scripts/activate
pytest --color yes -ra