Skip to content

Overhaul with Pydantic and format version generic 0.3 / model 0.5 #1084

Overhaul with Pydantic and format version generic 0.3 / model 0.5

Overhaul with Pydantic and format version generic 0.3 / model 0.5 #1084

Workflow file for this run

name: Test and Deploy bioimageio.spec
on:
push:
branches: [ main ]
pull_request:
branches: [ "**" ]
jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python-version: ['3.8', '3.9', '3.10', '3.11']
include:
- python-version: '3.8'
test-format: true
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
cache: 'pip'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[dev]
- name: Get Date
id: get-date
run: |
echo "week=$(/bin/date -u "+%Y-%U")" >> $GITHUB_OUTPUT
shell: bash
- uses: actions/cache@v3
with:
path: tests/cache
key: ${{ runner.os }}-${{ matrix.python-version }}-${{ steps.get-date.outputs.week }}-${{ hashFiles('**/lockfiles') }}
- name: Check autogenerated imports
run: python scripts/generate_version_submodule_imports.py check
- run: black .
if: matrix.test-format
- run: ruff
if: matrix.test-format
- run: pyright
- run: pytest
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v4
with:
python-version: '3.11'
cache: 'pip'
- name: Install dependencies
run: |
pip install --upgrade pip
pip install -e .[dev]
- name: Generate spec docs
run: python scripts/generate_spec_documentation.py
- name: Generate JSON schemas
run: python scripts/generate_json_schemas.py
- name: Generate developer docs
run: pdoc -o ./dist bioimageio.spec
- name: Get branch name to deploy to
id: get_branch
shell: bash
run: |
if [[ -n '${{ github.event.pull_request.head.ref }}' ]]; then branch=gh-pages-${{ github.event.pull_request.head.ref }}; else branch=gh-pages; fi
echo "::set-output name=branch::$branch"
- name: Deploy to ${{ steps.get_branch.outputs.branch }} 🚀
uses: JamesIves/github-pages-deploy-action@v4
with:
branch: ${{ steps.get_branch.outputs.branch }}
folder: dist
conda-build:
runs-on: ubuntu-latest
needs: test
steps:
- name: checkout
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Conda environment with Micromamba
uses: mamba-org/setup-micromamba@v1
with:
cache-downloads: true
cache-environment: true
environment-name: build-env
condarc: |
channels:
- conda-forge
create-args: >-
boa
- name: linux conda build
run: |
conda mambabuild -c conda-forge conda-recipe
shell: bash -l {0}