Build for more OSes #48
This file contains hidden or 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: Tests | |
on: | |
pull_request: | |
release: | |
types: [published] | |
push: | |
branches: | |
- main | |
- develop | |
jobs: | |
Test: | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
working-directory: ./code | |
strategy: | |
fail-fast: false | |
matrix: | |
os: | |
- ubuntu-latest | |
# - macos-10.15 # doesn't run for free | |
# - windows-2022 # can't actually run tests | |
version: | |
- '3.12' | |
- '3.10' | |
- '3.8' | |
# - 'pypy3.10' # broken PySide6 https://stackoverflow.com/a/76345084/3124150 | |
# - 'pypy3.9' # Make it work | |
# - 'pypy3.8' # broken PySide6 https://stackoverflow.com/a/76345084/3124150 | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
submodules: recursive | |
- name: Set up Python ${{ matrix.version }} | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.version }} | |
- name: Install linux deps | |
if: contains(matrix.os, 'ubuntu') | |
run: | | |
sudo apt install -y libopenblas-dev | |
- name: Upgrade pip | |
run: | | |
python -m pip install --upgrade pip | |
- name: Install deps | |
run: | | |
python -m pip install -r requirements.txt -r dev-requirements.txt | |
- name: Install jax for linux for Python 3.8 | |
if: contains(matrix.os, 'ubuntu') && matrix.version == '3.8' | |
run: | | |
python -m pip install "jax[cpu]" | |
- name: Test with pytest | |
run: python -m pytest tests/ --doctest-modules --junitxml=junit/test-results-${{ matrix.version }}.xml | |
- name: Upload pytest test results | |
uses: actions/upload-artifact@v4 | |
with: | |
name: pytest-results-${{ matrix.version }} | |
path: junit/test-results-${{ matrix.version }}.xml | |
# Use always() to always run this step to publish test results when there are test failures | |
if: ${{ always() }} |