Add GitHub Actions workflows#27
Conversation
- Add CI workflow for testing on multiple Node.js versions - Add Deploy workflow for automatic releases - Workflows run npm run lint and npm run build - Support for all branches and pull requests
fix branches
2787541 to
67b9a18
Compare
- ESLint 9.x requires Node.js 18+ due to structuredClone usage - Update CI to test only Node.js 18.x and 20.x - Fixes CI failure on Node.js 16.x
67b9a18 to
ddb24a8
Compare
| @@ -0,0 +1,39 @@ | |||
| name: CI | |||
There was a problem hiding this comment.
Can we rename this to Linter? The idea being that in the future, we might add a different CI job that is for unit tests.
There was a problem hiding this comment.
As far as I can see, this is the standard check file name used on GitHub. Are you sure you want to change it?
| run: npm run lint | ||
|
|
||
| - name: Build project | ||
| run: npm run build |
There was a problem hiding this comment.
Why do we need to build the project to run a linter? Linters just statically analyze code files. Consider removing all this build stuff.
There was a problem hiding this comment.
In Continuous Integration, we fully check the project build and its errors both during the build and during the linter.
| @@ -0,0 +1,51 @@ | |||
| name: Deploy | |||
There was a problem hiding this comment.
Does this actually deploy? Seems like all it does is increment the version number. Long term, I'd like to stop using version numbers, in order to simplify the deploy process. Simple deploys = better DX (developer experience). Eventually I want to get it added to https://gadget-deploy.toolforge.org/ so we have one click deploys.
Anyway, if all this github action does is increment the version, I'd suggest removing it.
There was a problem hiding this comment.
This file does one more check just in case and creates built (minified+bundle) files when adding a version tag. This is useful because any user can download the file they need without having to go to production.
There was a problem hiding this comment.
You create a tag "vNUMBER", the action sees it and deploys the files.
git tag -a v0.1.2 -m "Release notes..."
- Remove matrix strategy from CI - Use single Node.js 22 version for both CI and Deploy - Ensure consistency between testing and deployment environments - Remove main branch from Deploy triggers
- Add contents: write permission to deploy job - This allows the action to create releases and upload artifacts - Fixes 'Resource not accessible by integration' error
- Now release descriptions will show actual tag message from -m flag - Added dynamic tag message extraction step
- Remove master branch trigger from Deploy workflow - Now Deploy only runs when creating tags (v*) - CI workflow handles master branch pushes for testing
Uh oh!
There was an error while loading. Please reload this page.