Skip to content

openMINDS_Python_build_pipeline #593

openMINDS_Python_build_pipeline

openMINDS_Python_build_pipeline #593

Workflow file for this run

# MIT licensed
name: openMINDS_Python_build_pipeline
on:
push:
branches:
- pipeline
workflow_dispatch: # This triggers the workflow when a webhook is received
jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.9", "3.13", "3.14"]
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Run build
run: |
pip install -r requirements.txt
python build.py
- name: Test built package
run: |
pip install pytest pytest-cov
pip install ./target
if [ "${{ matrix.python-version }}" = "3.14" ]; then
# Put the in-tree build first on the path, so that coverage is recorded
# against target/openminds rather than the copy in site-packages, whose
# path changes with every Python patch release.
PYTHONPATH=target pytest -v --cov=openminds --cov-report term --cov-report lcov pipeline/tests
else
pytest -v pipeline/tests
fi
- name: Upload coverage to Coveralls
if: matrix.python-version == '3.14'
uses: coverallsapp/github-action@v2
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
file: coverage.lcov
parallel: false
fail-on-error: false
- name: Checkout main branch
uses: actions/checkout@v4
with:
ref: main
path: main
token: ${{ secrets.GITHUB_TOKEN }}
if: ${{ matrix.python-version == 3.13 }}
- name: Push to main
if: ${{ matrix.python-version == 3.13 }}
run: |
rsync -a --delete --exclude '.git/' --exclude 'img/' target/ main/
cd main
rm -rf build openMINDS.egg-info
git config --global user.email "openminds@ebrains.eu"
git config --global user.name "openMINDS pipeline"
if [[ $(git add . --dry-run | wc -l) -gt 0 ]]; then
git add .
git commit -m "build triggered by ${{ github.event_name }}"
git push -f
else
echo "Nothing to commit"
fi