Skip to content

Optimize torch segmenter #149

Optimize torch segmenter

Optimize torch segmenter #149

Workflow file for this run

# Copyright (c) 2025 Niels de Koeijer, Martin Bo Møller
#
# Permission is hereby granted, free of charge, to any person obtaining a copy of
# this software and associated documentation files (the "Software"), to deal in
# the Software without restriction, including without limitation the rights to
# use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
# the Software, and to permit persons to whom the Software is furnished to do so,
# subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
# FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
# COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
# IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
# CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
name: CI pipeline on main push
on:
push:
branches:
- main
release:
types:
- created
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up uv and octave
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
uv venv
source .venv/bin/activate
uv sync --dev
sudo apt-get update
sudo apt-get install -y octave
- name: Deploy Documentation
run: |
uv run mkdocs gh-deploy --force
- name: Run Tests
run: |
uv run pytest
- name: Run Type Checking
run: |
uv run pyright
- name: Run Linting
run: |
uv run ruff check
- name: Check Formatting
run: |
uv run ruff format --check
publish:
needs: deploy
runs-on: ubuntu-latest
if: github.event_name == 'release'
steps:
- name: Checkout Repository
uses: actions/checkout@v4
- name: Set up Python and uv
run: |
curl -LsSf https://astral.sh/uv/install.sh | sh
echo "$HOME/.cargo/bin" >> $GITHUB_PATH
uv venv
source .venv/bin/activate
uv sync --dev
- name: Build Package
run: |
uv build
- name: Publish to PyPI
env:
TWINE_USERNAME: __token__
TWINE_PASSWORD: ${{ secrets.PYPI_TOKEN }}
run: |
uv run twine upload dist/*