Skip to content

ci: Add GitHub Actions workflow and Dependabot config#8

Open
NAME-ASHWANIYADAV wants to merge 3 commits into
agones-dev:mainfrom
NAME-ASHWANIYADAV:ci/github-actions
Open

ci: Add GitHub Actions workflow and Dependabot config#8
NAME-ASHWANIYADAV wants to merge 3 commits into
agones-dev:mainfrom
NAME-ASHWANIYADAV:ci/github-actions

Conversation

@NAME-ASHWANIYADAV

Copy link
Copy Markdown
Contributor

Type of change

  • ⚙️ CI / tooling

What this PR does

Introduces a CI pipeline that runs on every push to main and all pull requests.
The pipeline executes: build → typecheck → lint → format check → test.

Also includes:

  • .gitignore fix: adds !.github exception so the workflow directory is tracked
  • Dependabot config for automated npm and GitHub Actions dependency updates
  • Concurrency control to cancel stale CI runs
  • Build artifact upload (14-day retention)
  • All actions pinned to exact commit SHAs for supply-chain security

Test plan

Automated checks

  • npm run build
  • npm run tsc
  • npm run lint
  • npm run format -- --check

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>
Comment thread .github/workflows/ci.yaml

- name: Upload build artifact
if: success()
uses: actions/upload-artifact@ea165f8d65b6e75b540449e92b4886f43607fa02 # v4

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.

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)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

@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🚀

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

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 ?

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.

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.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

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>
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.

3 participants