ghat
Templates for My personal GitHub Actions workflow templates for ghat
Example Usage
Initial setup
npx ghat voxpelli/ghatemplates/lint
npx ghat voxpelli/ghatemplates/nodejs --set jobs.test.strategy.matrix.node_version=\[12,14,16\]
Other useful:
npx ghat voxpelli/ghatemplates/exit-silently-on-unsupported
Update to latest version
npx ghat
Or preferably document your use of ghat
, and which version, by adding it as a dev dependency, then also add a dedicated npm script to indicate how to use it:
npm install --dev ghat
In "scripts"
in package.json
:
"sync-gh-actions": "ghat",
Then sync using:
npm run sync-gh-actions
Available actions
Static code analysis
lint/lint.yml
– usesnpm
– installs npm dependencies and then runs thecheck
npm script, which is expected to be available. Has a basic matrix set, testing on a single Node.js version on a single OS, but can be overridden.
Node.js CI
nodejs/nodejs.yml
– usesnpm
– basic one which installs npm dependencies and then runs thetest-ci
npm script across a matrix composed of Linux + Windows and a couple of relevant Node.js versions. The matrix is expected to be overridden with use specific settings.nodejs-pg/nodejs.yml
– usesnpm
– similar tonodejs/nodejs.yml
, but also sets up a Postgres database and sets aDATABASE_URL
with a connection URI as eg. the port may differ and thus can't be hard coded but also since the username and password in CI is probably different from what one uses eg. locally. By default has a more limited test matrix thannodejs/nodejs.yml
as it has an extra dimension which could mean a large amount of combinations.nodejs-coveralls/nodejs.yml
– usesnpm
– similar tonodejs/nodejs.yml
, but uploads test coverage data to Coveralls
Automatic Publishing
gh-publish/gh-publish.yml
– usesnpm
– contains two steps: First step installs npm dependencies, runs thebuild
npm script if available and finally runs thetest
npm script. Second step publishes the module to GitHub Package Registry.
Basic ones
npm-test/npm-test.yml
– usesnpm
– installs npm dependencies and then runs thebuild
npm script if available and then thetest
npm script. Has a basic matrix set, testing on a single Node.js version on a single OS, but can be overridden.