Skip to content

ci: reduce duplicated build and restore work without changing coverage #783

Closed

Description

@pedrosakuma

Context

PR #782 highlighted that the current workflows are functionally healthy, but still perform some equivalent setup/build work in isolated jobs. We should reduce runner time conservatively, without skipping checks, changing required check names, weakening test coverage, or introducing path-based exclusions.

Baseline from the PR #782 runs:

  • Build candidate images: 2m11s
  • ARM64 identity directory smoke: 2m11s
  • Build & Test: 2m34s
  • Format check: 1m39s
  • Frontend lint (smoke): 33s
  • Frontend a11y: 40s

Runs:

Proposed conservative scope

1. Reuse the trading-host Buildx cache in the ARM64 smoke build

The PR candidate job already builds backend/src/B3.Trading.Host/Dockerfile for linux/amd64,linux/arm64 using the trading-host GHA cache scope. The dependent identity-directory-arm64-smoke job builds the same Dockerfile for linux/arm64 again, but reads/writes a separate trading-host-arm64-smoke scope.

Allow the ARM64 smoke build to consume the completed trading-host cache while preserving its current independently loaded image and runtime smoke assertions. It may keep a separate write scope if that avoids cache contention.

2. Add the existing NuGet package cache pattern to the format job

build-test restores with an explicit ~/.nuget/packages cache. The independent format job performs another full restore without that cache configuration. Reuse the same cache-key convention in format; keep dotnet format --verify-no-changes unchanged.

3. Benchmark frontend bundle reuse before changing job dependencies

The frontend smoke and accessibility jobs independently install the root frontend dependencies and build frontend/dist. Reusing the bundle through an artifact could reduce runner work, but adding a producer/consumer dependency may increase wall-clock critical-path time because these jobs currently run in parallel.

Prototype or measure this separately and only adopt it if:

  • total runner work decreases;
  • end-to-end PR latency does not materially regress;
  • the a11y job still audits the exact bundle produced from the PR commit;
  • frontend tests, container smoke, axe and Lighthouse coverage remain unchanged.

Non-goals

  • no path filters or conditional skipping of required workflows;
  • no removal or consolidation of functional checks merely to save time;
  • no reduction in architectures, conformance profiles, tests, coverage collection, axe, or Lighthouse;
  • no changes to product/runtime behavior;
  • no broad workflow rewrite.

Acceptance criteria

  • ARM64 identity smoke consumes reusable layers from the preceding trading-host candidate build while still loading and booting a real linux/arm64 image.
  • The format job uses the repository's existing NuGet cache convention and still performs its own restore plus --verify-no-changes.
  • Required check names and branch-protection behavior remain unchanged.
  • All current CI, Docker, conformance, ARM64 runtime, frontend, and accessibility checks remain enabled.
  • Before/after timings are recorded from at least two representative PR runs.
  • The change demonstrates lower runner time and does not materially increase the PR critical path.
  • Any frontend artifact reuse is omitted if measurements show a wall-clock regression.

Activity

  1. pedrosakuma commented on Aug 7, 2026

    @pedrosakuma
    OwnerAuthor

    Measurement completed in PR #784. The NuGet cache experiment was rejected after a cache hit produced no restore improvement and added overhead. The final Buildx-only change was isolated on the second run: the ARM64 smoke imported only the prerequisite trading-host cache, every host build layer was CACHED, and the full smoke completed in 55s versus up to 2m11 when its dedicated cache was cold. No checks, architectures, or runtime assertions were removed.

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    enhancementNew feature or request

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions