From d5b6944f2cb7e8b06db2702d73ca059843c02b9b Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 5 Aug 2026 18:06:22 +0000 Subject: [PATCH 1/2] ci: reuse Build job artifacts in the Test matrix 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 --- .github/workflows/lint-build-test.yml | 18 +++++++++++++++--- 1 file changed, 15 insertions(+), 3 deletions(-) diff --git a/.github/workflows/lint-build-test.yml b/.github/workflows/lint-build-test.yml index bf3fa557..f03e8fe2 100644 --- a/.github/workflows/lint-build-test.yml +++ b/.github/workflows/lint-build-test.yml @@ -155,6 +155,15 @@ jobs: echo "Working tree dirty at end of job" exit 1 fi + - name: Upload build artifacts + uses: actions/upload-artifact@b7c566a772e6b6bfb58ed0dc250532a479d7789f # v6 + with: + name: package-dist-${{ github.sha }} + # Glob discards the path before the first wildcard (`packages/`), so + # the artifact root is `/dist/...`. Download into `packages/` + # to restore `packages//dist/...`. + path: packages/*/dist + retention-days: 1 test-scripts: name: Test Scripts @@ -181,7 +190,7 @@ jobs: test: name: Test runs-on: ubuntu-latest - needs: prepare + needs: [prepare, build] strategy: matrix: node-version: [20.x, 22.x] @@ -192,8 +201,11 @@ jobs: with: is-high-risk-environment: false node-version: ${{ matrix.node-version }} - - name: Build for tests - run: yarn workspace ${{ matrix.package-name }} build + - name: Restore build artifacts + uses: actions/download-artifact@37930b1c2abaa49bbe596cd826c3c89aef350131 # v7 + with: + name: package-dist-${{ github.sha }} + path: packages - run: yarn workspace ${{ matrix.package-name }} run test - name: Require clean working directory shell: bash From e05970e8a5e1f493b898b3db5d8b27201491b4ce Mon Sep 17 00:00:00 2001 From: Cursor Agent Date: Wed, 5 Aug 2026 19:04:14 +0000 Subject: [PATCH 2/2] build: run workspace builds in topological-dev order 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 --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 30b7a30e..170e1a37 100644 --- a/package.json +++ b/package.json @@ -13,7 +13,7 @@ ], "files": [], "scripts": { - "build": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build", + "build": "yarn workspaces foreach --all --no-private --topological-dev --parallel --interlaced --verbose run build", "build:clean": "yarn build:only-clean && yarn build", "build:docs": "yarn workspaces foreach --all --no-private --parallel --interlaced --verbose run build:docs", "build:only-clean": "rimraf -g 'packages/*/dist'",