Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(github-workflows): update build and test workflows for Crosswind #8

Open
wants to merge 15 commits into
base: master
Choose a base branch
from

Conversation

Dangeranger
Copy link
Member

Update the Github Actions workflows with the following changes.

  • Work with more up to date Actions versions
  • Build the package with more strict CI settings
  • Build the package with only production dependencies
  • Include coverage in the test results
  • Release the package using Node.js version 18.x LTS as the semantic-release tool requires

@Dangeranger Dangeranger requested a review from a team December 11, 2023 18:56
@Dangeranger Dangeranger self-assigned this Dec 11, 2023
@Dangeranger Dangeranger marked this pull request as draft December 11, 2023 19:07
Newer versions of Node.js such as 14.x, 16.x, and 18.x break the build,
so we need to remove them from the build matrix. In the future, we
should update the build to work with newer versions of Node.js.
@Dangeranger Dangeranger force-pushed the fix/update-the-github-actions-workflow-for-crosswind branch from ee2a233 to 7358c43 Compare December 11, 2023 19:18
@Dangeranger Dangeranger marked this pull request as ready for review December 11, 2023 19:21
@Dangeranger Dangeranger added the bug Something isn't working label Dec 11, 2023
@Dangeranger Dangeranger assigned rraabe and unassigned Dangeranger Dec 11, 2023
Changes to package.json reflect updates to the:
- Package version
- Forked package homepage
- Compatible Node.js engine versions
- Package contributors
The package version will be updated automatically by the CI/CD pipeline
when the build and tests succeed and a new release is created.
This commit adds the asset paths for the release workflow to NPM and
Github. This will allow for the download of assets from the Github
release page in addtion to installing via NPM.
This registry is the default registry for npm, but it can be overridden
in the repositry settings. This commit sets the registry to the default.
This commit removes the need for yarn and uses npm instead. This reduces
the number of tools needed to build the project and makes it easier to
contribute to the project. Yarn appeared to be used for convenience.
Some packages have been updated to a slightly newer minor version, and
the package-lock.json file has been updated to reflect this. The SHA512
signatures have been added to the package-lock.json file for all packages
that have them available. SHA512 are a more secure hash than SHA1, and
are now the default for npm.
When running the build workflow, we should use the CI mode to avoid
interactions with the user. This is especially important when running
the `npm install` command, which will fail if the user is not logged in
to the npm registry.
The publish workflow needs to be able to publish a Github release and
comment on issues and pull requests. It also needs to be able to use
OIDC tokens for future npm provenance verificiation. This commit
updates the workflow to request the necessary permissions.

Additional changes have been made to the workflow to ensure that the
correct Node.js version is used, that the npm cache is used, and that
the CI environment variable is set. The latter is necessary to ensure
that the `semantic-release` command is run in CI mode.
The terser-webpack-plugin is the successor to the uglifyjs-webpack-plugin
and is the recommended plugin for minifying JavaScript. It is more actively
maintained and has better support for ES6+ syntax.

Update the babel-loader to be more specific about the version of browsers
that we support. This will allow the terser-webpack-plugin to better
optimize the output.

BREAKING CHANGE: The uglifyjs-webpack-plugin is no longer used. The
terser-webpack-plugin is now used instead.
Webpack is now configured to only build the main bundle and to show
progress of the build as it is happening. The prior configuration would
also build the demostic bundle, which is not needed for the main package.
This commit updates the webpack configuration to omit dead browser
targets from the build. This should reduce the size of the bundle
significantly, improve the performance of the application, and ease the
maintenance burden of the project.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants