chore(ci): batch unit tests, add timeouts, optimize Dockerfile#1135
Merged
Conversation
- Batch 22 unit test jobs into 4 grouped jobs (uploads, packages-core, packages-services, graphql) — saves ~73% of unit test minutes from per-minute billing rounding. - Add timeout-minutes to all jobs: build (10m), unit-tests (10m), pg-tests (15m), integration-tests (15m), examples-types (15m). Prevents runaway jobs from burning money (default is 6h). - Optimize Dockerfile layer caching: use pnpm fetch to pre-populate the pnpm store before copying source code. The store layer only invalidates when pnpm-lock.yaml changes, not on every code change.
Contributor
🤖 Devin AI EngineerI'll be helping with this pull request! Here's what you should know: ✅ I will automatically:
Note: I can only respond to comments from users who have write access to this repository. ⚙️ Control Options:
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
Three optimizations to reduce CI costs and prevent waste:
1. Batch unit tests (22 jobs → 4 jobs)
Unit tests previously ran as 22 individual 2vcpu jobs, each with ~1 min of download/install overhead for tests that run in seconds. Due to per-minute billing rounding, this was billed as 44 2vcpu-minutes for ~5 min of actual test work.
Now grouped into 4 batched jobs:
uploadspackages-corepackages-servicesgraphqlEach batch runs tests sequentially using
::group::markers for clear log separation. Estimated savings: ~73% of unit test minutes (44 → ~12 2vcpu-minutes).2. Add timeout-minutes to all jobs
Prevents runaway jobs from burning money (default GitHub timeout is 6 hours):
build: 10 min (usually ~2 min)unit-tests: 10 min (usually ~2 min)pg-tests: 15 min (usually ~5-8 min)integration-tests: 15 min (usually ~5-8 min)examples-types: 15 min3. Dockerfile: pnpm fetch for layer caching
Adds a
pnpm fetchlayer that pre-populates the pnpm store using onlypnpm-lock.yaml. This layer is cached and only invalidated when dependencies change — not when source code changes. Subsequentpnpm install --frozen-lockfile --offlinelinks from the local store without network access.Review & Testing Checklist for Human
pnpm fetch+--offlinepattern should work with pnpm 10, but confirm the Docker image builds and the CLI shims workNotes
::group::/::endgroup::markers in the batch test step provide collapsible sections in the GitHub Actions log so you can still see which specific test in a batch failed.Link to Devin session: https://app.devin.ai/sessions/f42f42528fb0465684159227efbef017
Requested by: @pyramation