Repository navigation
ci: build the projects with the build all examples script - #313
Merged
Merged
Conversation
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>
|
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.



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 theprojectsdirectory. The matrix only keeps the maxGraph package variants (release and development), going from 14 jobs to 2, each runningnpm cionce instead of once per project.Script changes
npm run build --workspacesgives 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 ofset -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:--fail-at-end, all examples are built, the sizes are displayed, then the failed examples are listed and the script exits non-zero--helpis available, and unknown options are rejectedprojects/_sharedis 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 theirpackage.json, they resolve it through the workspace symlink). It is no longer built twice.Workflow changes
distdirectories of the release build are uploaded as a single artifact keeping the<project>/distlayout, and the job assembling the GitHub Pages site restructures it into one directory per projectubuntu-22.04toubuntu-24.04The check names change from
build_projects (<project>, <variant>)tobuild_projects (<variant>). No status check is required onmain, so nothing else needs updating.