This PR adds a basic GitHub Actions CI action for automated tests. This should hopefully make reviewing PRs a lot easier for you, as well as making sure support isn't dropped for older Node.JS versions.
Basically, this action will run on every git push (or GitHub Pull Request) and should give you a green tick if all the tests pass, and a red cross if anything fails, e.g.
You'll probably still want to do manual testing to make sure the result of running npm run build on https://github.com/richardtallent/vite-plugin-singlefile-example actually looks good, as this PR only checks if the command works without errors, it can't tell you if the generated index.html actually works.
As part of this PR, I also changed the prepublishOnly script to prepare, so that it also runs when doing npm ci, see https://docs.npmjs.com/cli/v9/using-npm/scripts#life-cycle-scripts. The prepare script is what most people use to build their packages, because it's:
run before local npm install
run before an npm install of a package installed by git, e.g. if you do
npm install git+https://github.com/richardtallent/vite-plugin-singlefile.git
run before npm publish or npm pack
NOT run when installing from https://npmjs.com or from a npm pack file.
This PR adds a basic GitHub Actions CI action for automated tests. This should hopefully make reviewing PRs a lot easier for you, as well as making sure support isn't dropped for older Node.JS versions.
Basically, this action will run on every
git push
(or GitHub Pull Request) and should give you a green tick if all the tests pass, and a red cross if anything fails, e.g.As an example, see my fork of your repo: https://github.com/aloisklink/vite-plugin-singlefile/tree/9cc63ec392d6f2be939c87959f520002c9253baf
You'll probably still want to do manual testing to make sure the result of running
npm run build
on https://github.com/richardtallent/vite-plugin-singlefile-example actually looks good, as this PR only checks if the command works without errors, it can't tell you if the generatedindex.html
actually works.As part of this PR, I also changed the
prepublishOnly
script toprepare
, so that it also runs when doingnpm ci
, see https://docs.npmjs.com/cli/v9/using-npm/scripts#life-cycle-scripts. Theprepare
script is what most people use to build their packages, because it's:npm install
npm install
of a package installed by git, e.g. if you donpm install git+https://github.com/richardtallent/vite-plugin-singlefile.git
npm publish
ornpm pack
npm pack
file.