Skip to content

Run CI tests in Docker image#359

Open
Dagonite wants to merge 1 commit into
mainfrom
ci-in-container
Open

Run CI tests in Docker image#359
Dagonite wants to merge 1 commit into
mainfrom
ci-in-container

Conversation

@Dagonite

@Dagonite Dagonite commented May 6, 2026

Copy link
Copy Markdown
Collaborator

Closes #25.

Description

  • Update test CI to build the Docker test image and run pytest inside the built container.
  • Add Dockerfile build stages for shared base, test, and runtime images.
  • Refresh .dockerignore so the Docker build context excludes local caches and generated files.

CI workflow now builds a Docker test image and runs pytest inside it instead of setting up Python and installing deps on the runner. Added TEST_IMAGE env, replaced setup-python and pip steps with docker/build-push-action, and mount the workspace so coverage.xml is written back. Dockerfile converted to multi-stage (base/test/runtime): copy minimal sources, install package in base, install test deps in test stage, and keep a runtime stage for production. .dockerignore updated to exclude more build/test artifacts and caches.
@Dagonite Dagonite marked this pull request as ready for review May 6, 2026 12:57
@Dagonite Dagonite requested a review from Copilot May 6, 2026 12:57

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR updates CI to execute pytest inside the project’s built Docker “test” image, aligning automated testing with the containerized environment the service is intended to run in (per Issue #25).

Changes:

  • Refactors the Dockerfile into multi-stage builds (base, test, runtime) to support test execution within a built image.
  • Updates the GitHub Actions test workflow to build the test stage image and run pytest via docker run, exporting coverage.xml to the workspace.
  • Refreshes .dockerignore to reduce build context noise by excluding common local caches and generated artifacts.

Reviewed changes

Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.

File Description
Dockerfile Introduces base/test/runtime stages to support container-based testing and runtime execution.
.github/workflows/test.yml Builds the Docker test image and runs pytest inside the built container, emitting coverage XML.
.dockerignore Expands ignored patterns to reduce Docker build context size and exclude local/generated files.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Dockerfile
Comment on lines 8 to 10
RUN python -m pip install --upgrade pip \
&& python -m pip install --no-cache-dir .

- name: Set up python
uses: actions/setup-python@a309ff8b426b58ec0e2a45f0f869d46889d02405 # v4.5.0
- name: Build test image
uses: docker/build-push-action@v7
@Pasarus

Pasarus commented Jun 10, 2026

Copy link
Copy Markdown
Member

@Dagonite When using copilot could you respond to it's review before putting it in the In review column so it's ready for a person's review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Run CI based on built containers

3 participants