Overhaul with Pydantic and format version generic 0.3 / model 0.5 #1038
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.spec | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ "**" ] | |
jobs: | |
black: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Check files using the black formatter | |
uses: rickstaa/action-black@v1 | |
id: action_black | |
with: | |
black_args: "." | |
- name: Annotate diff changes using reviewdog | |
if: steps.action_black.outputs.is_formatted == 'true' | |
uses: reviewdog/action-suggester@v1 | |
with: | |
tool_name: blackfmt | |
test: | |
runs-on: ubuntu-latest | |
strategy: | |
fail-fast: false | |
matrix: | |
python-version: ["3.8", "3.9", "3.10", "3.11"] | |
steps: | |
- uses: actions/checkout@v3 | |
- 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] | |
- uses: jakebailey/pyright-action@v1 | |
- name: Check autogenerated imports | |
run: python scripts/generate_version_submodule_imports.py check | |
- 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: Run tests | |
run: python -m unittest | |
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 | |
shell: bash -l {0} | |
run: | | |
conda mambabuild -c conda-forge conda-recipe | |
deploy: | |
runs-on: ubuntu-latest | |
needs: test | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: 3.9 | |
- name: Install dependencies | |
run: | | |
pip install . | |
- name: Generate spec docs | |
run: python scripts/generate_spec_documentation.py | |
- name: Generate JSON schemas | |
run: python scripts/generate_json_schemas.py | |
- 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 |