Skip to content

PyMC 5 migration

PyMC 5 migration #68

Workflow file for this run

name: tests
on:
push:
branches:
- main
pull_request:
branches:
- main
# Cancels all previous workflow runs for pull requests that have not completed.
concurrency:
# The concurrency group contains the workflow name and the branch name for pull requests
# or the commit hash for any other events.
group: ${{ github.workflow }}-${{ github.event_name == 'pull_request' && github.head_ref || github.sha }}
cancel-in-progress: true
jobs:
changes:
name: "check for changes"
runs-on: ubuntu-latest
outputs:
changes: ${{ steps.changes.outputs.src }}
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: changes
with:
filters: |
python: &python
- 'homepy/**/*.py'
src:
- *python
- '.github/workflows/*.yml'
- 'pyproject.toml'
pre-commit:
needs: changes
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' }}
steps:
- uses: actions/checkout@v3
- uses: actions/setup-python@v4
with:
python-version: '3.10'
- uses: pre-commit/[email protected]
tests:
needs:
- changes
- pre-commit
runs-on: ubuntu-latest
if: ${{ needs.changes.outputs.changes == 'true' && needs.pre-commit.result == 'success' }}
defaults:
run:
shell: bash -el {0}
strategy:
fail-fast: true
steps:
- uses: actions/checkout@v3
- uses: mamba-org/setup-micromamba@v2
with:
environment-file: envs/environment-test.yml
environment-name: homepy-test
init-shell: bash
cache-environment: true
- name: Install-package
run: |
pip install -e .[dev]
python --version
# Verify PyMC v5 is installed
python -c "import pymc; print(f'PyMC version: {pymc.__version__}'); assert pymc.__version__.startswith('5'), 'PyMC v5 required'"
- name: Run tests
run: |
python -m pytest -vv --cov=homepy --cov-report=xml --no-cov-on-fail --cov-report term-missing