Merge pull request #115 from neutrinoceros/tst/cleanup_setup_uv #271
This file contains 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: 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 | |
- 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 |