Skip to content

chore: support intra-repository dependencies - #126

Open
ulissesferreira wants to merge 2 commits into
mainfrom
ulissesferreira/ci-share-build-artifacts-cb0e
Open

chore: support intra-repository dependencies#126
ulissesferreira wants to merge 2 commits into
mainfrom
ulissesferreira/ci-share-build-artifacts-cb0e

Conversation

@ulissesferreira

@ulissesferreira ulissesferreira commented Aug 5, 2026

Copy link
Copy Markdown
Contributor

Summary

The Test matrix was rebuilding each package in isolation (yarn workspace <pkg> build), so workspace libraries like @metamask/snap-networks-utils were not available when dependents ran tests.

This PR makes two related changes:

1. CI: share Build job artifacts with Test matrix

The existing Build job becomes the single source of truth for compiled output:

  1. Build runs yarn build, then uploads packages/*/dist
  2. Test depends on Build, downloads those artifacts into packages/ (so paths restore correctly after glob stripping), and runs tests without rebuilding

upload-artifact / download-artifact are pinned to commit SHAs for zizmor. Same pattern as publish-release.yml. Lint and other jobs are unchanged.

2. Root build: topological workspace ordering

The root yarn build script now passes --topological-dev to yarn workspaces foreach. Workspace libraries build before packages that depend on them (via dependencies or devDependencies), while independent packages still build in parallel.

This aligns local development and the CI Build job with upcoming workspace dependencies (e.g. snaps importing @metamask/snap-networks-utils).

Test plan

  • CI Build job uploads package-dist-<sha>
  • Test matrix cells restore artifacts under packages/<pkg>/dist and pass without a per-package build step
  • Snap packages find dist/bundle.js for snaps-jest
  • Lint jobs still run without depending on Build
  • yarn workspaces foreach --topological-dev --dry-run run build accepts the updated root build script
Open in Web Open in Cursor 

Comment thread .github/workflows/lint-build-test.yml Fixed
Comment thread .github/workflows/lint-build-test.yml Fixed
Upload packages/*/dist from the monorepo Build job and restore them into
packages/ in each Test matrix cell so snaps-jest finds dist/bundle.js
without a per-package rebuild. Pin upload/download-artifact to commit SHAs.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the ulissesferreira/ci-share-build-artifacts-cb0e branch from d2334bb to d5b6944 Compare August 5, 2026 18:06
@cursor
cursor Bot changed the base branch from WPN-1497-messenger-plumbing to main August 5, 2026 18:06
@ulissesferreira
ulissesferreira marked this pull request as ready for review August 5, 2026 18:31
@ulissesferreira
ulissesferreira requested review from a team as code owners August 5, 2026 18:31
@ulissesferreira
ulissesferreira deployed to default-branch August 5, 2026 18:31 — with GitHub Actions Active
@cursor cursor Bot changed the title ci: reuse Build job artifacts in the Test matrix ci: reuse Build job artifacts and build workspace deps in order Aug 5, 2026
Add --topological-dev to the root yarn build script so workspace
libraries (e.g. @metamask/snap-networks-utils) finish building before
packages that depend on them. Keeps --parallel for independent packages.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
@cursor
cursor Bot force-pushed the ulissesferreira/ci-share-build-artifacts-cb0e branch from 9eb091f to e05970e Compare August 5, 2026 19:08
@ulissesferreira ulissesferreira changed the title ci: reuse Build job artifacts and build workspace deps in order chore: support intra-repository dependencies Aug 5, 2026
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.

3 participants