Add draft example scripts #43
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
name: Run tests | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
workflow_dispatch: | |
jobs: | |
run-tests: | |
name: ${{ matrix.name }} | |
runs-on: ${{ matrix.os }} | |
defaults: | |
run: | |
shell: bash | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.ref }}-${{ matrix.name }} | |
cancel-in-progress: true | |
strategy: | |
fail-fast: false | |
matrix: | |
include: | |
- { name: linux-python3.7-minimum , requirements: minimum, python-ver: "3.7" , os: ubuntu-latest } | |
- { name: linux-python3.12 , requirements: pinned , python-ver: "3.12", os: ubuntu-latest } | |
- { name: windows-python3.7-minimum , requirements: minimum, python-ver: "3.7" , os: windows-latest } | |
- { name: windows-python3.12 , requirements: pinned , python-ver: "3.12", os: windows-latest } | |
- { name: macos-python3.7-minimum , requirements: minimum, python-ver: "3.7" , os: macos-latest } | |
- { name: macos-python3.12 , requirements: pinned , python-ver: "3.12", os: macos-latest } | |
steps: | |
- name: Checkout repo | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: ${{ matrix.python-ver }} | |
- name: Install development/test dependencies | |
run: | | |
python -m pip install --upgrade pip | |
python -m pip install -r requirements-dev.txt | |
- name: Install minimum dependencies | |
if: matrix.requirements == 'minimum' | |
run: | | |
python -m pip install -r requirements-min.txt | |
- name: Install pinned dependencies | |
if: matrix.requirements == 'pinned' | |
run: | | |
python -m pip install -r requirements.txt | |
- name: Install package | |
run: | | |
python -m pip install -e . # must install in editable mode for coverage to find sources | |
python -m pip list | |
- name: Run tests | |
run: | | |
pytest | |
- name: Generate coverage report | |
run: | | |
python -m coverage xml # codecov uploader requires xml format | |
python -m coverage report -m | |
- name: Upload coverage to Codecov | |
uses: codecov/codecov-action@v4 | |
with: | |
fail_ci_if_error: true | |
env: | |
CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} |