ci: Test against 3.9, 3.10 and 3.11 #398
Workflow file for this run
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
# TODO: Not sure we actually need conda, better to test against | |
# the default of just using built in `pip` | |
name: tests | |
# Cancel previous tests for this branch if a new commit is pushed | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
on: | |
# Allow manual trigger of workflow | |
workflow_dispatch: | |
# Run tests on push/merge to main | |
push: | |
branches: | |
- main | |
# Run tests on anything that has a pull request to main/development | |
pull_request: | |
branches: | |
- main | |
- development | |
jobs: | |
pytest: | |
name: Test ${{ matrix.python-version }}-${{ matrix.os }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash # Default to using bash on all | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
os: ["ubuntu-latest", "macos-latest", "windows-latest"] # Try all, TODO Remove failing ones | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Add conda to system path | |
run: | | |
# $CONDA is an environment variable pointing to the root of the miniconda directory | |
echo $CONDA/bin >> $GITHUB_PATH | |
- name: Setup Python 3.9 | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Install dependencies | |
run: | | |
conda install -c anaconda swig | |
python -m pip install ".[dev]" | |
- name: Run pytest | |
run: pytest tests |