Skip to content

Add GitHub Actions workflows#27

Open
In1quity wants to merge 8 commits intowikimedia-gadgets:masterfrom
In1quity:github-actions
Open

Add GitHub Actions workflows#27
In1quity wants to merge 8 commits intowikimedia-gadgets:masterfrom
In1quity:github-actions

Conversation

@In1quity
Copy link
Copy Markdown

@In1quity In1quity commented Sep 14, 2025

  • Add CI workflow for testing
  • Add Deploy workflow for automatic releases
  • Workflows run npm run lint and npm run build
  • Support for master branch and pull requests

- 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
- 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
@@ -0,0 +1,39 @@
name: CI
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need to build the project to run a linter? Linters just statically analyze code files. Consider removing all this build stuff.

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@In1quity In1quity Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Copy Markdown
Author

@In1quity In1quity Sep 15, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants