feat(continuous-integration): add container input for OCI-based CI execution #260
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Overview
This PR adds support for running the continuous integration workflow inside a Docker container instead of checking out files locally. This enables testing the exact same environment that will be deployed to production.
Motivation
When building Docker images for production deployment, it's critical to ensure that CI checks (linting, building, testing) are performed in the same environment that will run in production. Previously, the workflow only supported checking out code and setting up the Node.js environment on the runner, which could lead to discrepancies between the tested and deployed environments.
Changes
New Workflow Input
Added a new optional
containerinput parameter:string""(empty string, maintains current behavior)Updated Jobs
Modified all CI jobs (
setup,lint,build,test) to support container execution:container:configuration to each job that conditionally uses the specified imageif: inputs.container == ''npm runwhen in container modeDocumentation
Updated
.github/workflows/continuous-integration.mdwith:containerparameter in the inputs tableTest Coverage
Enhanced
.github/workflows/__test-workflow-continuous-integration.ymlto validate both modes:This ensures the feature works correctly in both traditional and container-based execution modes.
Usage Example
Backward Compatibility
✅ Fully backward compatible. The
containerinput defaults to an empty string, so existing workflows continue to function without any changes.Testing
Benefits
Original prompt
💬 We'd love your input! Share your thoughts on Copilot coding agent in our 2 minute survey.