Update adapters and converters #277
Workflow file for this run
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Test and Deploy bioimageio.core | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ "**" ] | |
defaults: | |
run: | |
shell: bash -el {0} | |
jobs: | |
black: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: psf/black@stable | |
with: | |
options: "--check" | |
src: "." | |
jupyter: true | |
version: "24.3" | |
test-spec-conda: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: '3.8' | |
conda-env: py38 | |
- python-version: '3.9' | |
conda-env: wo-python | |
- python-version: '3.9' | |
conda-env: tf | |
- python-version: '3.10' | |
conda-env: wo-python | |
- python-version: '3.11' | |
conda-env: full | |
run-expensive-tests: true | |
- python-version: '3.12' | |
conda-env: wo-python | |
- python-version: '3.13' | |
conda-env: wo-python | |
steps: | |
- id: get-env-name | |
run: | | |
echo "env-name=conda-${{ matrix.conda-env }}-${{ matrix.python-version }}" | |
echo "env-name=conda-${{ matrix.conda-env }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT | |
shell: bash | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: true | |
activate-environment: ${{steps.get-env-name.outputs.env-name}} | |
channel-priority: strict | |
miniforge-version: latest | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(date +'%Y-%b')" | |
echo "date=$(date +'%Y-%b')" >> $GITHUB_OUTPUT | |
echo "today=$(date -u '+%Y%m%d')" | |
echo "today=$(date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Cache env | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CONDA }}/envs/${{steps.get-env-name.outputs.env-name}} | |
key: >- | |
conda-${{ runner.os }}-${{ runner.arch }} | |
-${{steps.get-date.outputs.today }} | |
-${{ hashFiles(matrix.conda-env) }} | |
-${{env.CACHE_NUMBER }} | |
env: | |
CACHE_NUMBER: 0 | |
id: cache | |
- name: Update env | |
run: conda env update --name=${{steps.get-env-name.outputs.env-name}} --file=dev/env-${{matrix.conda-env}}.yaml python=${{matrix.python-version}} | |
if: steps.cache.outputs.cache-hit != 'true' | |
- uses: actions/cache@v4 | |
with: | |
path: bioimageio_cache | |
key: "test-spec-conda-${{ steps.get-date.outputs.date }}" | |
- name: pytest-spec-conda | |
run: pytest --disable-pytest-warnings | |
env: | |
BIOIMAGEIO_CACHE_PATH: bioimageio_cache | |
RUN_EXPENSIVE_TESTS: ${{ matrix.run-expensive-tests && 'true' || 'false' }} | |
test-spec-main: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
include: | |
- python-version: '3.8' | |
conda-env: py3.8 | |
- python-version: '3.9' | |
conda-env: tf | |
- python-version: '3.11' | |
conda-env: full | |
report-coverage: true | |
run-expensive-tests: true | |
- python-version: '3.12' | |
conda-env: tf | |
steps: | |
- id: get-env-name | |
run: | | |
echo "env-name=main-${{ matrix.conda-env }}-${{ matrix.python-version }}" | |
echo "env-name=main-${{ matrix.conda-env }}-${{ matrix.python-version }}" >> $GITHUB_OUTPUT | |
- uses: actions/checkout@v4 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: true | |
activate-environment: ${{steps.get-env-name.outputs.env-name}} | |
channel-priority: strict | |
miniforge-version: latest | |
- name: Get Date | |
id: get-date | |
run: | | |
echo "date=$(date +'%Y-week%U')" | |
echo "date=$(date +'%Y-week%U')" >> $GITHUB_OUTPUT | |
echo "today=$(date -u '+%Y%m%d')" | |
echo "today=$(date -u '+%Y%m%d')" >> $GITHUB_OUTPUT | |
- name: Cache env | |
uses: actions/cache@v4 | |
with: | |
path: ${{ env.CONDA }}/envs/${{steps.get-env-name.outputs.env-name}} | |
key: >- | |
conda-${{ runner.os }}-${{ runner.arch }} | |
-${{steps.get-date.outputs.today }} | |
-${{ hashFiles(matrix.conda-env) }} | |
-${{env.CACHE_NUMBER }} | |
env: | |
CACHE_NUMBER: 0 | |
id: cache | |
- name: Update env | |
run: | | |
conda env update --name=${{steps.get-env-name.outputs.env-name}} --file=dev/env-${{matrix.conda-env}}.yaml python=${{matrix.python-version}} | |
conda remove --yes --force bioimageio.spec | |
if: steps.cache.outputs.cache-hit != 'true' | |
- name: Install spec from main branch | |
run: pip install --no-deps git+https://github.com/bioimage-io/spec-bioimage-io | |
- uses: actions/cache@v4 | |
with: | |
path: bioimageio_cache | |
key: "test-spec-main-${{ steps.get-date.outputs.date }}" | |
- name: pytest-spec-main | |
run: pytest --disable-pytest-warnings | |
env: | |
BIOIMAGEIO_CACHE_PATH: bioimageio_cache | |
RUN_EXPENSIVE_TESTS: ${{ matrix.run-expensive-tests && 'true' || 'false' }} | |
- if: matrix.report-coverage && github.event_name == 'pull_request' | |
uses: orgoro/[email protected] | |
with: | |
coverageFile: coverage.xml | |
token: ${{ secrets.GITHUB_TOKEN }} | |
- if: matrix.report-coverage && github.ref == 'refs/heads/main' | |
run: | | |
pip install genbadge[coverage] | |
genbadge coverage --input-file coverage.xml --output-file ./dist/coverage/coverage-badge.svg | |
coverage html -d dist/coverage | |
- if: matrix.report-coverage && github.ref == 'refs/heads/main' | |
uses: actions/upload-artifact@v4 | |
with: | |
name: coverage | |
retention-days: 1 | |
path: dist | |
conda-build: | |
needs: test-spec-conda | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- uses: conda-incubator/setup-miniconda@v3 | |
with: | |
auto-update-conda: true | |
auto-activate-base: true | |
activate-environment: "" | |
channel-priority: strict | |
miniforge-version: latest | |
conda-solver: libmamba | |
- name: install common conda dependencies | |
run: conda install -n base -c conda-forge conda-build -y | |
- uses: actions/cache@v4 | |
with: | |
path: | | |
pkgs/noarch | |
pkgs/channeldata.json | |
key: ${{ github.sha }}-packages | |
- name: linux conda build test | |
shell: bash -l {0} | |
run: | | |
mkdir -p ./pkgs/noarch | |
conda-build -c conda-forge conda-recipe --no-test --output-folder ./pkgs | |
docs: | |
needs: [test-spec-main] | |
if: github.ref == 'refs/heads/main' | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/download-artifact@v4 | |
with: | |
name: coverage | |
path: dist | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.12' | |
cache: 'pip' | |
- run: pip install -e .[dev] | |
- name: Generate developer docs | |
run: ./scripts/pdoc/run.sh | |
- run: cp README.md ./dist/README.md | |
- name: copy rendered presentations | |
run: | | |
mkdir ./dist/presentations | |
cp -r ./presentations/*.html ./dist/presentations/ | |
- name: Deploy to gh-pages 🚀 | |
uses: JamesIves/github-pages-deploy-action@v4 | |
with: | |
branch: gh-pages | |
folder: dist |