diff --git a/.github/workflows/package.yaml b/.github/workflows/package.yaml index ad6ef41..b61b2fc 100644 --- a/.github/workflows/package.yaml +++ b/.github/workflows/package.yaml @@ -3,7 +3,7 @@ name: Build Python package on: [push, pull_request] jobs: - build-package: + dry-run: runs-on: ubuntu-latest diff --git a/.github/workflows/tests.yaml b/.github/workflows/tests.yaml index 11a54dc..16bdd49 100644 --- a/.github/workflows/tests.yaml +++ b/.github/workflows/tests.yaml @@ -64,6 +64,37 @@ jobs: run: | coveralls --service=github + test-docker: + name: Build docker image and run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: docker/setup-qemu-action@v3 + - 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 image run unit tests + env: + IMAGE: ${{ github.repository }}:${{ github.sha }} + NAME: deepcell-spots-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-spots/requirements-test.txt + docker exec ${{ env.NAME }} pip install -r /opt/deepcell-spots/requirements-test.txt + docker exec ${{ env.NAME }} pytest /opt/deepcell-spots/deepcell + docker kill ${{ env.NAME }} && docker rm ${{ env.NAME }} + + coveralls: name: Finish Coveralls needs: tests