This document specifies the requirements for improving the CI/CD performance for both the API and WUI projects by implementing parallel execution, caching, and workflow restructuring.
The current CI/CD workflows (ci.yaml in both API and WUI) are highly sequential and redundant:
* Redundant Cloning: Every job re-clones all repositories in the monorepo structure.
* Redundant Building: Deployment jobs often re-build Docker images that were already built and tested in previous steps.
* Sequential Testing: Tests run one after another within a single large job.
* Heavyweight Setup: Starting the entire Docker compose environment for simple unit tests or type checks adds significant overhead.
We will split the monolithic build-and-test jobs into discrete, parallelizable jobs:
lint-and-typecheck: Parallel job for ruff and mypy.unit-tests: Parallel job for fast unit tests (no Docker needed if possible, or use a lightweight container).integration-tests: Parallel job for tests requiring Redis/Tesla Mock.typecheck: Parallel job for vue-tsc.lint: Parallel job for eslint.unit-tests: Parallel job for Vitest/Jest.e2e-tests: Parallel job for Puppeteer (using the existing language matrix).sha-${{ github.sha }}) and push it to the GCP Artifact Registry early in the pipeline.test and deploy jobs should pull this pre-built image instead of running make do-setup-api-no-cache or similar commands.Implement dorny/paths-filter to detect which sub-projects changed:
* If only bnc-cpt-wui/ changed, skip the full API test suite.
* If only bnc-cpt-api/ changed, skip the WUI E2E tests.
* Always run full suite on merges to master.
type=gha cache backend for Docker builds.~/.cache/pip and ~/.cache/pypoetry.~/.npm and node_modules.actions/upload-artifact to share the initial git clone/setup across jobs within a single run, reducing 3-5 minutes of cloning per job.Update the utl project with helper scripts for CI:
* do_ci_upload_workspace: Script to bundle and upload the cloned repos.
* do_ci_download_workspace: Script to restore the workspace.
setup job that clones and uploads the workspace.build job that pushes the candidate image to Artifact Registry.tests into parallel jobs that depend on build.deploy to use the image from build.setup and build separation.type-check, lint, and e2e-tests.