Skip to content

Commit

Permalink
build(docker): refine docker build tests
Browse files Browse the repository at this point in the history
Co-Authored-By: Ken Brewer <[email protected]>
  • Loading branch information
d33bs and kenibrewer committed Mar 17, 2024
1 parent 99d4936 commit bc093ef
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
14 changes: 7 additions & 7 deletions .github/workflows/integration-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,10 @@ jobs:
runs-on: ubuntu-latest
# set a dependency sequence to occur after build job completion
needs: build
env:
version: ${{ needs.build.outputs.version }}
sdist_filename: pycytominer-${{ needs.build.outputs.version}}.tar.gz
sdist_extracted_name: pycytominer-${{ needs.build.outputs.version}}
steps:
# checks out selected files for docker image build testing
- name: Checkout selected files
Expand All @@ -162,14 +166,10 @@ jobs:
with:
name: sdist
# gather the sdist tar.gz name (which varies)
- name: Get sdist tar.gz
id: get_sdist_tar_gz
run: |
echo "filename=$(ls ./*.tar.gz)" >> "$GITHUB_OUTPUT"
# unzips the sdist
- name: Extract sdist
run: |
tar -xzvf "${{ steps.get_sdist_tar_gz.outputs.filename }}"
tar -xzvf "${{ env.sdist_filename}}"
# note: roughly follows Docker documentation on GitHub Actions usage
# found on the following https://github.com/docker/build-push-action
- name: Set up QEMU
Expand All @@ -182,11 +182,11 @@ jobs:
# where we attempt to use 1.0.1.post37.dev0+55690e4 as a version label.
- name: Build docker image for testing
run: |
cd "$(echo "${{ steps.get_sdist_tar_gz.outputs.filename }}" | sed 's/\.tar\.gz$//')" && \
cd "${{ env.sdist_extracted_name }}" && \
cp -r ../tests . && \
docker build -f ../build/docker/Dockerfile \
-t pycytominer:testing \
--label version="$(basename "$(pwd)" | sed 's/pycytominer-//')" \
--label version="${{ env.version }}" \
--target testing \
.
# runs pytest for pycytominer within a docker container based on the image above
Expand Down
2 changes: 1 addition & 1 deletion build/docker/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ FROM base as production
COPY . .

# install pycytominer using poetry root dependencies and all extras
RUN poetry install --only-root --all-extras -v --no-interaction
RUN poetry install --all-extras -v --no-interaction

# create stage for production build (no dev or non-essential deps)
FROM production as testing
Expand Down

0 comments on commit bc093ef

Please sign in to comment.