Skip to content

ci: reuse Build job artifacts in the Test matrix - #126

Closed
ulissesferreira wants to merge 1 commit into
WPN-1497-messenger-plumbingfrom
ulissesferreira/ci-share-build-artifacts-cb0e
Closed

ci: reuse Build job artifacts in the Test matrix#126
ulissesferreira wants to merge 1 commit into
WPN-1497-messenger-plumbingfrom
ulissesferreira/ci-share-build-artifacts-cb0e

Conversation

@ulissesferreira

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 change makes the existing Build job the single source of truth:

  1. Build runs yarn build (already topological), then uploads packages/**/dist
  2. Test depends on Build, downloads those artifacts, and runs tests without rebuilding

Same pattern as publish-release.yml. Lint and other jobs are unchanged.

Test plan

  • CI Build job uploads package-dist-<sha>
  • Test matrix cells restore artifacts and pass without a per-package build step
  • @metamask/tron-wallet-snap tests pass with @metamask/snap-networks-utils present in dist/
  • Lint jobs still run without depending on Build
Open in Web Open in Cursor 

Upload packages/*/dist from the Build job and restore them in each
Test matrix cell so workspace libraries are available before Jest runs,
without rebuilding per package.

Co-authored-by: Ulisses Ferreira <ulisses@hey.com>
exit 1
fi
- name: Upload build artifacts
uses: actions/upload-artifact@v6
- name: Build for tests
run: yarn workspace ${{ matrix.package-name }} build
- name: Restore build artifacts
uses: actions/download-artifact@v7
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