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

✨ (go/v4) Add GitHub Actions #4110

Merged
merged 1 commit into from
Sep 14, 2024

Conversation

camilamacedo86
Copy link
Member

@camilamacedo86 camilamacedo86 commented Aug 28, 2024

Within the changes of this PR new projects will become to be scaffold with GitHub actions which will allow users be aware of how to test their changes on the ci.

Either will make clear the purpose of the test-e2e and encorage common/best practices to ensure the quality of the properties

Closes: #4088

@k8s-ci-robot k8s-ci-robot added the cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. label Aug 28, 2024
@k8s-ci-robot k8s-ci-robot requested a review from Kavinjsir August 28, 2024 07:54
@k8s-ci-robot k8s-ci-robot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Aug 28, 2024
@k8s-ci-robot k8s-ci-robot added the size/XL Denotes a PR that changes 500-999 lines, ignoring generated files. label Aug 28, 2024
@camilamacedo86 camilamacedo86 changed the title ✨ Add GitHub Actions ✨ (go/v4) Add GitHub Actions Aug 28, 2024
@camilamacedo86 camilamacedo86 force-pushed the add-github-ci branch 18 times, most recently from ba717f3 to 2b58377 Compare August 28, 2024 09:41
@camilamacedo86 camilamacedo86 changed the title ✨ (go/v4) Add GitHub Actions WIP ✨ (go/v4) Add GitHub Actions Aug 28, 2024
@k8s-ci-robot k8s-ci-robot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Aug 28, 2024
@camilamacedo86 camilamacedo86 force-pushed the add-github-ci branch 6 times, most recently from b8fb2aa to 77decdb Compare August 29, 2024 05:26
@camilamacedo86 camilamacedo86 changed the title WIP ✨ (go/v4) Add GitHub Actions ✨ (go/v4) Add GitHub Actions Aug 29, 2024
@k8s-ci-robot k8s-ci-robot added do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Aug 29, 2024
@camilamacedo86
Copy link
Member Author

/hold cancel
It seems fine to fly 🚀

@k8s-ci-robot k8s-ci-robot removed the do-not-merge/hold Indicates that a PR should not merge because someone has issued a /hold command. label Sep 2, 2024
@@ -161,6 +162,9 @@ func (s *initScaffolder) Scaffold() error {
&templates.Golangci{},
&e2e.Test{},
&e2e.SuiteTest{},
&github.E2eTestCi{},
&github.TestCi{},
Copy link
Contributor

Choose a reason for hiding this comment

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

@camilamacedo86 Everything looks good to me. Just one question: Is it necessary to maintain separate files for each of GH Action template?

Copy link
Member Author

Choose a reason for hiding this comment

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

We want to set up 3 separate jobs as follows:

Screenshot 2024-09-03 at 18 53 41

Each job will have its own file so that if a failure occurs, it's easy to identify which target/job/test failed. Running the jobs in parallel will also make the process faster and easier to manage.

This separation also makes it clear which file corresponds to each task: test.yml for tests, lint.yml for linting, and so on. This approach simplifies any future changes and helps maintain clarity—if everything were in the same file, it would be more challenging to pinpoint issues and make updates.

Copy link
Contributor

Choose a reason for hiding this comment

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

@camilamacedo86 makes sense to maintain the separation of concern. Everything else seems good for now.

Copy link
Contributor

@Kavinjsir Kavinjsir left a comment

Choose a reason for hiding this comment

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

Looks good to me! 🚀

- name: Run linter
uses: golangci/golangci-lint-action@v6
with:
version: v1.59
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: what about using the latest release v1.61.0?

Copy link
Member Author

Choose a reason for hiding this comment

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

I added the same version that we are using.
so we can upgrade all by once

Copy link
Contributor

Choose a reason for hiding this comment

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

Sounds good!


- name: Running Test e2e
run: |
go mod tidy
Copy link
Contributor

Choose a reason for hiding this comment

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

Nit: looks like an additional indent here?

Copy link
Member Author

@camilamacedo86 camilamacedo86 Sep 10, 2024

Choose a reason for hiding this comment

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

Lets fix this one before get merged
Good catcher !!

/hold

@k8s-ci-robot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: camilamacedo86, Kavinjsir, TAM360

The full list of commands accepted by this bot can be found here.

The pull request process is described here

Needs approval from an approver in each of these files:
  • OWNERS [Kavinjsir,camilamacedo86]

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

Add GitHub actions to the default scaffold.

Motivation:
- help developers use the tests in the CI
- make clear the purpose of the e2e tests scaffolds
- encourage good practices and standard approachs
@camilamacedo86
Copy link
Member Author

/hold cancel

Now it is good to fly 🎉

@camilamacedo86 camilamacedo86 added the lgtm "Looks good to me", indicates that a PR is ready to be merged. label Sep 14, 2024
@k8s-ci-robot k8s-ci-robot merged commit 9a8b2f8 into kubernetes-sigs:master Sep 14, 2024
21 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. cncf-cla: yes Indicates the PR's author has signed the CNCF CLA. lgtm "Looks good to me", indicates that a PR is ready to be merged. size/XL Denotes a PR that changes 500-999 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Enhance the e2e test scaffolding and add a GitHub Action to demonstrate their usage
4 participants