kubewharf / kubezoo

a lightweight kubernetes multi-tenancy gateway
Apache License 2.0
682 stars 57 forks source link

ci: add github actions workflow to run go tests #39

Open jiridanek opened 3 months ago

jiridanek commented 3 months ago

What type of PR is this?

testing/ci enhancements

What this PR does / why we need it:

tests and builds the project on every push and pull request, helping to maintain basic code quality

Which issue(s) this PR fixes:

the tests weren't compiling, so I also had to make changes to tests so that they compile again

Special notes for your reviewer:

the PR is meant to be squashed

followup PR will also enable e2e tests with envtest, I will have to either update go version or extensively edit Makefile to make it working (see commit message on the last commit here)

giving up on e2e tests with env test for now

 + cd /home/runner/work/_temp/go/pkg/mod/sigs.k8s.io/controller-runtime/tools/setup-> envtest@v0.0.0-20240522175850-2e9781e9fc60
+ GOBIN=/home/runner/work/kubezoo/kubezoo/bin go install ./
go: errors parsing go.mod:
/home/runner/work/_temp/go/pkg/mod/sigs.k8s.io/controller-runtime/tools/setup-envtest@v0.0.0-20240522175850-2e9781e9fc60/go.mod:3: invalid go version '1.22.0': must match format 1.23

This seems to be fixed by either using older envtest or newer go

CLAassistant commented 3 months ago

CLA assistant check
All committers have signed the CLA.

jiridanek commented 3 months ago

The GHA is not running, it either needs enabling in repo settings, or approval from maintainer to run for the first time, or maybe GHAs on PR don't run until there is some existing GHA in main branch.

Anyways, here's how it looks like on my fork https://github.com/jiridanek/kubezoo/actions/runs/9223347207

jiridanek commented 3 months ago

Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.

Yeah, @ddevault is right https://drewdevault.com/2023/07/04/Dont-sign-a-CLA-2.html, btw, but, after I eventually signed CLA with Oracle and got indirectly employed by IBM, every other corp is lesser evil in my eyes ;O