Skip to content

0.5.0

0.5.0 #174

name: CI
on:
push:
branches:
- main
pull_request:
branches:
- main
release:
types:
- published
jobs:
lint:
name: Lint
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v3
with:
python-version: '3.10'
- name: Run pre-commit linting
run: pipx run pre-commit run --all-files
test-core:
name: Core Tests - ${{ matrix.platform }} py${{ matrix.python-version }} ilp=${{ matrix.ilp }} sam2=${{ matrix.sam2 }}
runs-on: ${{ matrix.platform }}
defaults:
run:
shell: bash -l {0}
strategy:
fail-fast: true
matrix:
python-version: ["3.10", "3.11", "3.12", "3.13"]
platform: [ubuntu-latest]
ilp: ["false"]
sam2: ["false"]
include:
- platform: windows-latest
python-version: "3.10"
ilp: "false"
sam2: "false"
- platform: macos-latest
python-version: "3.10"
ilp: "false"
sam2: "false"
- platform: ubuntu-latest
python-version: "3.10"
ilp: "true"
sam2: "false"
- platform: macos-latest
python-version: "3.12"
ilp: "false"
sam2: "true"
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: ${{ matrix.python-version }}
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true
- name: Install ilp dependencies
if: matrix.ilp == 'true'
run: mamba install -c gurobi -c funkelab ilpy
- name: Install package with core dependencies
run: python -m pip install -e .[test]
- name: Install additional dependencies for SAM2 features tests
if: matrix.sam2 == 'true'
run: python -m pip install -e .[test,etultra]
- name: Run core tests
run: pytest tests -v -s --color=yes -m core
test-train:
name: Training Tests - ubuntu-latest py3.10
runs-on: ubuntu-latest
defaults:
run:
shell: bash -l {0}
steps:
- uses: actions/checkout@v4
- uses: conda-incubator/setup-miniconda@v3
with:
python-version: "3.10"
miniforge-version: latest
use-mamba: true
channels: conda-forge
channel-priority: true
- name: Install package with training dependencies
run: python -m pip install -e .[train,test]
- name: Run training tests
run: pytest tests -v -s --color=yes -m train
upload_pypi:
name: Upload package to PyPi
needs: [lint, test-core, test-train]
runs-on: ubuntu-latest
if: github.event_name == 'release' && github.event.action == 'published' # upload to pypi only on release
steps:
- name: Checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- run: python3 -m pip install --upgrade build && python3 -m build
- name: Publish package to PyPi
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
verbose: true