Add Python 3.13 to the test matrix #77
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: Tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
# Allows you to run this workflow manually from the Actions tab | |
workflow_dispatch: | |
inputs: | |
poetry: | |
type: boolean | |
description: "Use Poetry-based workflow." | |
required: false | |
default: true | |
# Allow this workflow to be called from other repositories. | |
workflow_call: | |
inputs: | |
poetry: | |
type: boolean | |
description: "Use Poetry-based workflow." | |
required: false | |
default: true | |
jobs: | |
run-tests: | |
name: ${{ matrix.os }}, ${{ matrix.python-version }} | |
runs-on: ${{ matrix.os }} | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-latest, macos-latest, windows-latest] | |
python-version: ['3.10', '3.11', '3.12', '3.13'] | |
steps: | |
- uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-version }} | |
- name: Set up Poetry | |
if: ${{ inputs.poetry }} | |
uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: "1.8.3" | |
- name: Install dependencies with Poetry | |
if: ${{ inputs.poetry }} | |
run: | | |
poetry install --with test --all-extras | |
poetry add git+https://github.com/AstarVienna/ScopeSim_Data.git | |
- name: Run Pytest with Poetry | |
if: ${{ inputs.poetry }} | |
run: poetry run pytest -m "not webtest" --cov --cov-report=xml | |
- name: Install dependencies without Poetry | |
if: ${{ ! inputs.poetry }} | |
run: | | |
python -m pip install --upgrade pip | |
pip install git+https://github.com/AstarVienna/ScopeSim_Data.git | |
# Install this clone of the project. This is relevant because for | |
# example ScopeSim has ScopeSim_Templates as a test-dependency | |
# and that package has ScopeSim as a dependency. So the PyPI version | |
# of ScopeSim would be installed without the "pip install ." line. | |
pip install . | |
# TODO: It should not be necessary to install the dev dependencies. | |
# Perhaps create a separate test for that? | |
pip install .[test,dev] | |
pip install pytest pytest-cov | |
- name: Run Pytest without Poetry | |
if: ${{ ! inputs.poetry }} | |
run: pytest -m "not webtest" --cov --cov-report=xml | |
- name: Upload coverage reports to Codecov | |
uses: codecov/codecov-action@v4 | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |