Skip to content

ci: build the projects with the build all examples script - #313

Merged
redfish4ktc merged 1 commit into
mainfrom
feat/build_all_examples_fail_at_end
Oct 4, 2026
Merged

redfish4ktc merged 1 commit into
mainfrom
feat/build_all_examples_fail_at_end

Conversation

@redfish4ktc

@redfish4ktc redfish4ktc commented Oct 4, 2026 •

Copy link
Copy Markdown
Member

The CI build job used a matrix listing every project by hand, so adding or removing an example also required updating the workflow. The CI now runs build-all-examples.bash --fail-at-end, which discovers the projects from the projects directory. The matrix only keeps the maxGraph package variants (release and development), going from 14 jobs to 2, each running npm ci once instead of once per project.

Script changes

npm run build --workspaces gives no control on failures: npm always keeps going after a failing workspace and only exposes the exit code of the last failure, and there is no option to change this. The script then stopped because of set -e, so the bundle sizes were never displayed and there was no summary of the failed examples.

The examples are now built one by one with npm run build -w, like in the maxGraph repository script:

  • by default, the script stops at the first failure
  • with --fail-at-end, all examples are built, the sizes are displayed, then the failed examples are listed and the script exits non-zero
  • --help is available, and unknown options are rejected

projects/_shared is still built first and outside the loop, and its failure always stops the script. npm does not order workspaces by dependency (the examples do not declare it in their package.json, they resolve it through the workspace symlink). It is no longer built twice.

Workflow changes

  • the dist directories of the release build are uploaded as a single artifact keeping the <project>/dist layout, and the job assembling the GitHub Pages site restructures it into one directory per project
  • the workflow also runs when the script changes
  • the runners are bumped from ubuntu-22.04 to ubuntu-24.04

The check names change from build_projects (<project>, <variant>) to build_projects (<variant>). No status check is required on main, so nothing else needs updating.

The CI build job used a matrix listing every project by hand, so adding or removing an example also required updating
the workflow. The projects are now built by `build-all-examples.bash --fail-at-end`, which discovers them from the
`projects` directory, so the matrix only keeps the maxGraph package variants (release and development). This reduces
the number of jobs from 14 to 2, each running `npm ci` once instead of once per project.

The script previously built everything with `npm run build --workspaces`, which gives no control on failures: npm
always keeps going after a failing workspace, reports the error inline and only exposes the exit code of the last
failure. The script then stopped because of `set -e`, so the bundle sizes were never displayed and there was no
summary of the failed examples. npm provides no option to change this.

The examples are now built one by one with `npm run build -w`, like in the maxGraph repository script. By default,
the script stops at the first failure. With `--fail-at-end`, all examples are built, the sizes are displayed, then
the failed examples are listed and the script exits non-zero.

The shared project is still built first and outside the loop, and its failure always stops the script. npm does not
order workspaces by dependency (the examples do not even declare it in their package.json, they resolve it through
the workspace symlink), so relying on the alphabetical order would be fragile. It was also built twice before, as
`projects/*` matches it.

The `dist` directories of the release build are now uploaded as a single artifact keeping the `<project>/dist`
layout, and the job assembling the GitHub Pages site restructures it into one directory per project. The workflow
now also runs when the script changes, and the runners are bumped from ubuntu-22.04 to ubuntu-24.04.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@redfish4ktc redfish4ktc added the chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...) label Oct 4, 2026
@sonarqubecloud

sonarqubecloud Bot commented Oct 4, 2026

Copy link
Copy Markdown

@redfish4ktc
redfish4ktc merged commit 8b3aead into main Oct 4, 2026
9 checks passed
@redfish4ktc
redfish4ktc deleted the feat/build_all_examples_fail_at_end branch October 4, 2026 04:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

chore Build, CI/CD or repository tasks (issues/PR maintenance, environments, ...)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant