Skip to content

Centralize npm run build job#5776

Merged
compulim merged 9 commits intomainfrom
ci-group-build
Mar 12, 2026
Merged

Centralize npm run build job#5776
compulim merged 9 commits intomainfrom
ci-group-build

Conversation

@compulim
Copy link
Contributor

@compulim compulim commented Mar 11, 2026

Changelog Entry

(No changelog for workflow update.)

Description

Today, every job in the pull request validation workflow run npm run build on their own.

Tomorrow, we centralize the npm run build and pack/upload the artifact. So all jobs will use the very same artifacts.

Design

The bigger idea: use npm pack and tar -xf --strip-components=1 to pack/unpack /dist/ et al. This should work because all build artifacts should be included by package.json/files.

The idea:

  1. Build phase
    1. npm clean-install
    2. npm run build
    3. npm pack, note: the tarball filenames are not straightforward to compute from package.json/[name|version]
    4. Zip up /**/*.tgz recursively without flattening folder structure
      • So we can just do tar -xf *.tgz in their respective package folder
    5. Upload artifact
  2. Run phase
    1. npm clean-install to rehydrates node_modules, needed to run bundle as it depends on core et al.
    2. Download artifact
    3. Extract *.tgz back to their original package folder
    4. npm exec --workspaces --call 'tar -xf *.tgz --strip-components=1 --skip-old-files'
      • --call is needed for tar
      • Extract *.tgz in-place
      • --strip-components=1 because this is npm pack, it always pack into /package/
      • --skip-old-files is optional, feel better with it

npm pack --workspaces vs. npm exec --workspaces -- npm pack

npm pack --workspaces will have pack destination at the root package.

npm exec --workspaces -- npm pack will have pack destination at individual package.

Specific Changes

  • Added upload/pack/download/extract step to PR validation workflow
  • Updated .gitignore to ignore .tgz/.tar
  • I have added tests and executed them locally
  • I have updated CHANGELOG.md
  • I have updated documentation

Review Checklist

This section is for contributors to review your work.

  • Accessibility reviewed (tab order, content readability, alt text, color contrast)
  • Browser and platform compatibilities reviewed
  • CSS styles reviewed (minimal rules, no z-index)
  • Documents reviewed (docs, samples, live demo)
  • Internationalization reviewed (strings, unit formatting)
  • package.json and package-lock.json reviewed
  • Security reviewed (no data URIs, check for nonce leak)
  • Tests reviewed (coverage, legitimacy)

@compulim compulim changed the title [WIP] Centralize npm run build job Centralize npm run build job Mar 12, 2026
@compulim compulim marked this pull request as ready for review March 12, 2026 17:26
Copilot AI review requested due to automatic review settings March 12, 2026 17:26
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Centralizes the PR validation build by packaging workspace outputs once and reusing them across subsequent jobs, reducing duplicated npm run build work and improving artifact consistency between jobs.

Changes:

  • Add a build step to npm pack all workspaces, bundle the resulting .tgz files into a single tar artifact, and upload it for downstream jobs.
  • Update several jobs (static analysis, unit tests, type-definition tests) to download/extract/unpack the shared tarballs instead of rebuilding.
  • Expand build-browser verification to run on a macOS/Ubuntu/Windows matrix, and update .gitignore entries to ignore generated .tgz/.tar artifacts.

Reviewed changes

Copilot reviewed 24 out of 25 changed files in this pull request and generated no comments.

Show a summary per file
File Description
.github/workflows/pull-request-validation.yml Packs workspace tarballs in build, uploads them as an artifact, and updates downstream jobs to reuse them; expands build-browser to a 3-OS matrix.
.gitignore Ignores root-level *.tar artifacts produced by the workflow.
packages/vibe-grep/.gitignore Ignores workspace-produced .tgz tarballs and node_modules/.
packages/test/web-server/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns (dist/, node_modules/).
packages/test/test-assets/.gitignore Ignores workspace .tgz tarballs.
packages/test/page-object/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/test/harness/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/test/dev-server/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/support/cldr-data/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/support/cldr-data-downloader/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/repack/react@umd/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react@baseline/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react-is/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react-dom@umd/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react-dom@baseline/.gitignore Ignores workspace .tgz tarballs.
packages/repack/react-dom/.gitignore Ignores workspace .tgz tarballs.
packages/repack/object-assign/.gitignore Ignores workspace .tgz tarballs.
packages/repack/microsoft-cognitiveservices-speech-sdk/.gitignore Ignores workspace .tgz tarballs.
packages/repack/html-react-parser/.gitignore Ignores workspace .tgz tarballs.
packages/repack/botframework-directlinejs/.gitignore Ignores workspace .tgz tarballs.
packages/repack/base64-js/.gitignore Ignores workspace .tgz tarballs.
packages/repack/adaptivecards/.gitignore Ignores workspace .tgz tarballs.
packages/isomorphic-react/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.
packages/isomorphic-react-dom/.gitignore Ignores workspace .tgz tarballs; normalizes ignored folder patterns.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Copy link
Collaborator

@OEvgeny OEvgeny left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🚀

@compulim compulim merged commit 2ffb130 into main Mar 12, 2026
62 of 64 checks passed
@compulim compulim deleted the ci-group-build branch March 12, 2026 20:13
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