Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Feat/test-github-action #30

Merged
merged 8 commits into from
Jun 16, 2021
Merged

Feat/test-github-action #30

merged 8 commits into from
Jun 16, 2021

Conversation

knechtionscoding
Copy link
Contributor

@knechtionscoding knechtionscoding commented Jun 7, 2021

Summary

Adds two github actions:

  • test (on matric of versions)
  • publish to ghcr on release publish events

Modifies test setup:

  • uses newer version of setupenv-test and kubebuilder to allow for in ci testing

Docs:

  • updates docs to cover new commands in makefile

Details:

When running in github, we obviously don't have etcd or other tooling installed by default. The script that was being used to download all of the env setup wasn't working properly in github (I have some failed actions demonstrating that).
In April of this year, controller-runtime switched to a new method: kubernetes-sigs/controller-runtime@782807d#diff-051375546db9782e3debc25e0241edf1d5e5e2ec0f183dd8634ca5b2c8968bb8

I mimic'd that method with a few modifications to match what was currently happening. I left everything as a makefile script for now, but we may want to move the test-setup command to a bash script at some point to make it easier.
You'll note the addition of an ENV variable, that's based on: kubernetes-sigs/kubebuilder#326

I've currently dropped the kube-builder tools into /tmp/kube-builder but they could theoretically be anywhere. This is really only relevant to people working on the operator.

If there is a different method wanted, then I can explore that route.

I've also configured it so it can run a matrix of tests. This will allow us to test the operator on a variety of linux platforms, with a variety of golang versions, and a variety of k8s versions. I've only included one of each for now for demonstration,
but we can obviously add more.

works towards #20

Successful example here: https://github.com/KnechtionsCoding/operator/runs/2765262646

Next Steps

@simskij will probably need to follow: https://docs.github.com/en/packages/managing-github-packages-using-github-actions-workflows/publishing-and-installing-a-package-with-github-actions#upgrading-a-workflow-that-accesses-ghcrio to allow the actions/workflow to publish to ghcr

Signed-off-by: Hans Knecht <[email protected]>
feat: update makefile with test_setup command
fix: remove unnecessary script
docs: update readme.md with new testing information

Signed-off-by: Hans Knecht <[email protected]>
Signed-off-by: Hans Knecht <[email protected]>
Signed-off-by: Hans Knecht <[email protected]>
@dgzlopes dgzlopes requested a review from simskij June 16, 2021 07:51
Copy link
Member

@dgzlopes dgzlopes left a comment

Choose a reason for hiding this comment

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

Thanks! Left one small comment :)

.github/workflows/push.yaml Outdated Show resolved Hide resolved
@simskij
Copy link
Contributor

simskij commented Jun 16, 2021

Added the permissions needed to ghcr.io. Once you've sorted out @dgzlopes suggestion, I'm happy to merge it. :)

@dgzlopes dgzlopes merged commit 38407a1 into grafana:main Jun 16, 2021
@knechtionscoding knechtionscoding deleted the feat/github-actions branch June 16, 2021 14:45
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