ci: reuse Build job artifacts in the Test matrix - #126
Closed
ulissesferreira wants to merge 1 commit into
Closed
Conversation
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 |
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
The Test matrix was rebuilding each package in isolation (
yarn workspace <pkg> build), so workspace libraries like@metamask/snap-networks-utilswere not available when dependents ran tests.This change makes the existing Build job the single source of truth:
yarn build(already topological), then uploadspackages/**/distSame pattern as
publish-release.yml. Lint and other jobs are unchanged.Test plan
package-dist-<sha>@metamask/tron-wallet-snaptests pass with@metamask/snap-networks-utilspresent indist/