Skip to content

Commit

Permalink
Merge pull request #338 from bioimage-io/ci-env-caching
Browse files Browse the repository at this point in the history
Ci env caching
  • Loading branch information
FynnBe authored May 16, 2023
2 parents 131d2c3 + 16d7c0f commit 53dfc45
Showing 1 changed file with 16 additions and 21 deletions.
37 changes: 16 additions & 21 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,15 @@ on:
pull_request:
branches: [ "**" ]

defaults:
run:
shell: bash -l {0}

jobs:
black:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Check files using the black formatter
uses: rickstaa/action-black@v1
id: action_black
Expand All @@ -28,20 +32,18 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: false # debugging: torch does not detect onnxruntime
cache-env: true
environment-file: dev/environment-torch.yaml
extra-specs: |
python=${{ matrix.python-version }}
- name: additional setup
shell: bash -l {0}
run: pip install --no-deps -e .
- name: pytest-spec-conda
shell: bash -l {0}
run: pytest --disable-pytest-warnings

test-spec-main:
Expand All @@ -50,23 +52,21 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: false # todo: detect env cache hit and adapt(skip?) additional setup (conda remove?)
cache-env: true
environment-file: dev/environment-torch.yaml
extra-specs: |
python=${{ matrix.python-version }}
- name: additional setup
shell: bash -l {0}
run: |
conda remove --yes --force bioimageio.spec
conda remove --yes --force bioimageio.spec || true # allow failure for cached env
pip install --no-deps git+https://github.com/bioimage-io/spec-bioimage-io
pip install --no-deps -e .
- name: pytest-spec-main
shell: bash -l {0}
run: pytest --disable-pytest-warnings

test-spec-tf:
Expand All @@ -75,24 +75,22 @@ jobs:
matrix:
python-version: [3.7, 3.8, 3.9]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: false # todo: detect env cache hit and adapt(skip?) additional setup (conda remove?)
cache-env: true
environment-file: dev/environment-tf.yaml
channel-priority: flexible
extra-specs: |
python=${{ matrix.python-version }}
- name: additional setup
shell: bash -l {0}
run: |
conda remove --yes --force bioimageio.spec
conda remove --yes --force bioimageio.spec || true # allow failure for cached env
pip install --no-deps git+https://github.com/bioimage-io/spec-bioimage-io
pip install --no-deps -e .
- name: pytest-spec-tf
shell: bash -l {0}
run: pytest --disable-pytest-warnings

test-spec-tf-legacy:
Expand All @@ -101,24 +99,22 @@ jobs:
matrix:
python-version: [3.7]
steps:
- uses: actions/checkout@v2
- uses: actions/checkout@v3
- name: Install Conda environment with Micromamba
uses: mamba-org/provision-with-micromamba@main
with:
cache-downloads: true
cache-env: false # todo: detect env cache hit and adapt(skip?) additional setup (conda remove?)
cache-env: true
environment-file: dev/environment-tf-legacy.yaml
channel-priority: flexible
extra-specs: |
python=${{ matrix.python-version }}
- name: additional setup
shell: bash -l {0}
run: |
conda remove --yes --force bioimageio.spec
conda remove --yes --force bioimageio.spec || true # allow failure for cached env
pip install --no-deps git+https://github.com/bioimage-io/spec-bioimage-io
pip install --no-deps -e .
- name: pytest-spec-tf-legacy
shell: bash -l {0}
run: pytest --disable-pytest-warnings

conda-build:
Expand All @@ -140,6 +136,5 @@ jobs:
extra-specs: |
boa
- name: linux conda build
shell: bash -l {0}
run: |
conda mambabuild -c conda-forge conda-recipe

0 comments on commit 53dfc45

Please sign in to comment.