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

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from

Conversation

jiridanek
Copy link

@jiridanek jiridanek commented May 24, 2024

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-> [email protected]
+ 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/[email protected]/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

Some tests did not compile, so I also did the minimal amount of changes to get them compiling and passing.
```
 + cd /home/runner/work/_temp/go/pkg/mod/sigs.k8s.io/controller-runtime/tools/[email protected]
+ 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/[email protected]/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

* golang/go#61888
@CLAassistant
Copy link

CLAassistant commented May 24, 2024

CLA assistant check
All committers have signed the CLA.

@jiridanek jiridanek changed the title Jd add gha ci: add github actions workflow to run go tests May 24, 2024
@jiridanek
Copy link
Author

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
Copy link
Author

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

.github/workflows/tests.yaml Outdated Show resolved Hide resolved
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