Skip to content

ci

ci #2388

Workflow file for this run

---
name: ci
on:
push:
branches: [main]
paths:
- src/*
- tests/*
- integration_tests/*
- docs/*
- pyproject.toml
- setup.py
pull_request:
workflow_dispatch: ~
schedule:
- cron: "0 */6 * * *" # every 6 hours
jobs:
ci:
runs-on: ${{ matrix.os }}
permissions:
contents: read
actions: read
checks: write
strategy:
matrix:
os: [ubuntu-latest, macos-latest]
python-version: ["3.9", "3.10", "3.11", "3.12", "3.13", "3.14"]
fail-fast: false
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: install system dependencies (Linux)
if: runner.os == 'Linux'
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi3 libopenmpi-dev
- name: install system dependencies (macOS)
if: runner.os == 'macOS'
run: |
brew install open-mpi
- name: install haddock3 with extra dependencies
run: pip install -e '.[mpi,dev,docs,notebooks]'
- name: run unit tests
run: >-
pytest -v --random-order tests/
--cov --cov-report=
- name: run integration tests
run: >-
pytest -v --random-order integration_tests/
- name: generate coverage report
run: |
coverage report
coverage xml
- uses: codacy/codacy-coverage-reporter-action@v1
if: matrix.python-version == '3.14'
with:
project-token: ${{ secrets.CODACY_PROJECT_TOKEN }}
coverage-reports: ./coverage.xml
- name: check if docs are buildable
continue-on-error: true
run: |
sphinx-apidoc -f -e -o docs/ src/haddock -d 1
sphinx-build docs haddock3-docs