Skip to content

Make vector package optional (#110) #335

Make vector package optional (#110)

Make vector package optional (#110) #335

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: tests
concurrency:
group: ${{ github.ref }}
cancel-in-progress: true
on:
workflow_dispatch:
push:
tags:
- "*"
branches:
- main
- develop
- "release/*"
- "hotfix/*"
pull_request:
branches-ignore:
- "docs/*"
- "doc/*"
jobs:
codecov:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ["3.9"]
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt install graphviz -y
pip install -e .[dev]
pip install coverage
- name: Download test data
run: python data/download_test_files.py > /dev/null
- name: Run pytest-cov
run: coverage run -m pytest --basetemp={envtmpdir}
- name: Create XML report
run: coverage xml
- uses: codecov/[email protected]
with:
file: ./coverage.xml
pytest:
runs-on: ${{ matrix.os }}
name: tests on ${{ matrix.os }} with ${{ matrix.python-version }}
strategy:
fail-fast: false
matrix:
os: [ ubuntu-latest ]
python-version: ["3.10", "3.12"]
# include: # todo: activate when we can install graphviz on these platforms
# - os: macos-latest
# python-version: "3.9"
# - os: windows-latest
# python-version: "3.9"
# - os: macos-14 # Apple silicon runner
# python-version: '3.12'
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Get number of CPU cores
uses: SimenB/github-actions-cpu-cores@v2
id: cpu-cores
- name: Install dependencies
run: |
python -m pip install --upgrade pip
sudo apt install graphviz -y
pip install -e .[dev]
- name: Download test data
run: python data/download_test_files.py > /dev/null
- name: Test with pytest (compiled)
run: |
PHASESPACE_EAGER=0 pytest --basetemp={envtmpdir} tests
cd docs
PHASESPACE_EAGER=0 pytest --dist loadscope --nbval-lax --ignore=.ipynb_checkpoints -n${{ steps.cpu-cores.outputs.count }}
cd ..
- name: Test with pytest (eager mode)
run: |
PHASESPACE_EAGER=1 pytest --basetemp={envtmpdir} tests
cd docs
PHASESPACE_EAGER=1 pytest --dist loadscope --nbval-lax --ignore=.ipynb_checkpoints -n${{ steps.cpu-cores.outputs.count }}
cd ..