-
Notifications
You must be signed in to change notification settings - Fork 17
106 lines (100 loc) · 3.18 KB
/
build.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
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:
matrix:
python-version: [3.7, 3.8, 3.9]
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 .[test]
- name: Test with pytest
run: pytest tests
- name: Check passthrough models
run: python scripts/generate_passthrough_modules.py check
# todo: add mypy checks for python 3.10 when we can add KW_ONLY to dataclasses
# allowing dataclass inheritance w/o the 'missing' default value
# - name: MyPy
# if: ${{ matrix.python-version == '3.10' }}
# run: |
# mkdir -p .mypy-cache
# mypy . --install-types --non-interactive --cache-dir .mypy-cache --explicit-package-bases --check-untyped-defs
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/provision-with-micromamba@main
with:
environment-file: false
environment-name: build-env
channels: conda-forge
extra-specs: |
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 Docs
run: python scripts/generate_rdf_docs.py
- name: Generate pre-/postprocessing docs
run: python scripts/generate_processing_docs.py
- name: Generate weight formats docs
run: python scripts/generate_weight_formats_docs.py
- name: Generate JSON Schema
run: python scripts/generate_json_specs.py
- name: Generate weight formats overview
run: python scripts/generate_weight_formats_overview.py generate
- 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