Skip to content

Training segmentation example notebook fixes #1361

Training segmentation example notebook fixes

Training segmentation example notebook fixes #1361

Workflow file for this run

# This workflow will install Python dependencies, run tests and lint with a single version of Python
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: build
on: [push, pull_request]
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
tests:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ['3.7', '3.8', '3.9', '3.10']
steps:
- uses: actions/checkout@v4
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Cache Python
uses: actions/cache@v3
with:
path: ${{ env.pythonLocation }}
key: ${{ env.pythonLocation }}-${{ hashFiles('requirements.txt') }}-${{ hashFiles('requirements-test.txt') }}
restore-keys: |
${{ env.pythonLocation }}-
- name: Install Dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
pip install -r requirements-test.txt
- name: PyTest
run: |
pytest --cov deepcell
- name: Coveralls
if: env.COVERALLS_REPO_TOKEN != null
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
COVERALLS_FLAG_NAME: ${{ matrix.python-version }}
COVERALLS_PARALLEL: true
run: |
coveralls
# A job that runs the test suite using the development version of the
# deepcell dependencies: deepcell-tracking and deepcell-toolbox.
# This ensures consistency across unreleased versions of deepcell libraries
test-dev:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.7", "3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v4
- name: Setup Python ${{ matrix.python-version }}
uses: actions/setup-python@v5
with:
python-version: ${{ matrix.python-version }}
- name: Install deepcell-tf and dependencies
run: |
python -m pip install --upgrade pip wheel setuptools
# Install deepcell-tf from source
python -m pip install -r requirements.txt
python -m pip install .
python -m pip install -r requirements-test.txt
- name: Manually install dev version of toolbox
run: |
git clone https://github.com/vanvalenlab/deepcell-toolbox.git && cd deepcell-toolbox
python -m pip uninstall DeepCell-Toolbox -y
python -m pip install .
- name: Manually install dev version of tracking
run: |
git clone https://github.com/vanvalenlab/deepcell-tracking.git && cd deepcell-tracking
python -m pip uninstall DeepCell-Tracking -y
python -m pip install .
- name: List dependencies
run: |
python -m pip install --upgrade numpy\<2
python -m pip list
- name: Run tests
run: |
pytest --pyargs deepcell
coveralls:
name: Finish Coveralls
needs: tests
runs-on: ubuntu-latest
steps:
- name: Coveralls Finished
uses: coverallsapp/github-action@master
if: env.COVERALLS_REPO_TOKEN != null
env:
COVERALLS_REPO_TOKEN: ${{ secrets.COVERALLS_REPO_TOKEN }}
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
parallel-finished: true
test-docker:
name: Build Docker and Run Tests
runs-on: ubuntu-latest
steps:
# Attempt to free up space in workflow container
- name: Delete tools folder
run: rm -rf /opt/hostedtoolcache
- uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Cache Docker layers
uses: actions/cache@v3
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Build and Run Unit Tests
env:
IMAGE: ${{ github.repository }}:${{ github.sha }}
NAME: deepcell-test
run: |
docker buildx build --load --tag ${{ env.IMAGE }} .
docker run -d -it \
--entrypoint=bash \
--name ${{ env.NAME }} \
${{ env.IMAGE }}
docker cp requirements-test.txt ${{ env.NAME }}:/opt/deepcell-tf/requirements-test.txt
docker exec ${{ env.NAME }} pip install -r /opt/deepcell-tf/requirements-test.txt
docker exec ${{ env.NAME }} pytest /opt/deepcell-tf/deepcell
docker kill ${{ env.NAME }} && docker rm ${{ env.NAME }}