Add GitHub Actions workflow for automated testing (#15) #29
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.
Overview of the Workflow
This GitHub Actions workflow automates the testing of the
fastify-swc-server
CLI by installing the npm package and executing its bin script as if it were installed directly from the npm registry. This ensures the package performs as expected in a real-world usage scenario before pull requests are merged. The process includes validating the package's functionality, enabling compatibility with HTTPS for repository access, and addressing a required Node.js version upgrade.The workflow performs the following steps:
actions/checkout
action.pnpm
package manager is set up with a specific version to handle dependency installation and management.lts/*
), ensuring compatibility with the latest features and dependencies.pnpm
, while skipping theprepare
script to prevent issues during installation.npm pack
to package the CLI and installs it globally, verifying that thefastify-swc-server
bin script works as expected.These additional changes were required for the completion of the workflow:
git clone
command executed in thebin
script to support HTTPSThis setup supports a process where a version bump is the last change merged before the updated version is published to npm. This final step adds an additional layer of validation to ensure that the npm package, including any version updates, functions correctly. By testing the package’s functionality in the CI/CD pipeline, it confirms the integrity of the package and verifies that it works as intended before being made publicly available.
Closes #15