ci: Add GitHub Actions workflow and Dependabot config#8
ci: Add GitHub Actions workflow and Dependabot config#8NAME-ASHWANIYADAV wants to merge 3 commits into
Conversation
Update .gitignore to add an exception for the .github folder. This is required so that the GitHub Actions CI workflows and templates can be committed and tracked by Git, as they were previously excluded by the global '.*' rule. Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
Introduce a CI pipeline to automatically build, lint, format, and test the plugin on every pull request and push to the main branch. Includes concurrency control, pinned actions, artifact uploads, and Dependabot configuration to keep dependencies updated. Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
|
|
||
| - name: Upload build artifact | ||
| if: success() | ||
| uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4 |
There was a problem hiding this comment.
I don't know github actions super well (or headlamp plugins) -- what are we uploading here, and, I guess also - why? (not saying it's bad -- just curious as to the reasoning)
There was a problem hiding this comment.
Hey @markmandel , it uploads the compiled plugin so reviewers can download the ZIP and drop it directly into their Headlamp plugins folder to test instantly, without needing to clone the code and run npm build themselves
its saves time and efforts to use terminal to review any pr
There was a problem hiding this comment.
I like the idea, I'm just wondering if this should be part of another PR related to the release process ?
https://headlamp.dev/docs/latest/development/plugins/publishing/
Otherwise I'm fine with it
There was a problem hiding this comment.
@lacroixthomas, thanks for the link!
Should I remove the artifact upload from this PR and handle it in a separate release workflow PR instead 🤔?
Let me know what works best🚀
There was a problem hiding this comment.
I'm actually fine to keep it, I just wonder if this could be an "issue" about storage if it's too big as it would be ran each time 🤔 Even though it would only be kept for 14 days
I pretty like the idea about it, but I would maybe say that let's not keep it for the time being and see with the flow, if we see that it would make sense to directly use this zip or if people would actually build it locally (as they would need a cluster either way to set it up etc / maybe minikube or so if it's just a test)
I don't really mind actually, I'm easy on this one, what do you think about it @markmandel ?
There was a problem hiding this comment.
Yeah, let's keep it - I like the idea. Makes testing PRs that people make also easy 👍🏻
I assume we also have a way to approve that the workflow runs that runs this? We shouldn't have it run automatically on every PR.
There was a problem hiding this comment.
I have updated the workflow to split the artifact upload into a separate job that requires a GitHub Environment (environment: artifact-upload)
Now, the build, lint, and test jobs will run automatically on every PR, but the actual artifact upload step will pause and require a maintainer to manually approve it (especially for fork PRs). We just need to create an artifact-upload environment in the repo settings and add maintainers as required reviewers.
Here is the official GitHub documentation on how this works: Using environments for deployment - Required reviewers
Signed-off-by: ashwani yadav <22ashwaniyadav@gmail.com>
fc3ecbd to
4b8e09f
Compare
Type of change
What this PR does
Introduces a CI pipeline that runs on every push to
mainand all pull requests.The pipeline executes: build → typecheck → lint → format check → test.
Also includes:
.gitignorefix: adds!.githubexception so the workflow directory is trackedTest plan
Automated checks
npm run buildnpm run tscnpm run lintnpm run format -- --check