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

🌱 Workflow pipeline with unit tests #1770

Merged
merged 1 commit into from
Jun 5, 2024

Conversation

lentzi90
Copy link
Member

@lentzi90 lentzi90 commented Jun 5, 2024

What this PR does / why we need it:

This adds a unit test workflow and restructures the github workflows
so that we run golangci-lint and unit tests first. Only when they have
succeded will the pipeline continue with e2e tests.
The goal is to conserve resources and avoid running pointless jobs.
The commit also removes unnecessary permissions and avoids running the
jobs if the PR is a draft.

Which issue(s) this PR fixes (optional, in fixes #<issue number>(, fixes #<issue_number>, ...) format, will close the issue(s) when PR gets merged):
Fixes #

@metal3-io-bot
Copy link
Contributor

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@metal3-io-bot metal3-io-bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jun 5, 2024
@lentzi90 lentzi90 marked this pull request as ready for review June 5, 2024 08:09
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@lentzi90 lentzi90 marked this pull request as draft June 5, 2024 08:12
@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@lentzi90 lentzi90 force-pushed the lentzi90/e2e-pipeline branch 2 times, most recently from 980b557 to 27eaf03 Compare June 5, 2024 08:51
@lentzi90
Copy link
Member Author

lentzi90 commented Jun 5, 2024

Alright that works as expected! Now the workflows do not run on drafts.

@lentzi90 lentzi90 marked this pull request as ready for review June 5, 2024 08:54
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@lentzi90
Copy link
Member Author

lentzi90 commented Jun 5, 2024

Oh! They are only triggered on PR opening... Turning this back to draft so I can test also that properly. The workflows should be triggered on editing the PR.

@lentzi90 lentzi90 marked this pull request as draft June 5, 2024 08:56
@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@metal3-io-bot metal3-io-bot added size/L Denotes a PR that changes 100-499 lines, ignoring generated files. and removed size/M Denotes a PR that changes 30-99 lines, ignoring generated files. labels Jun 5, 2024
@lentzi90 lentzi90 marked this pull request as ready for review June 5, 2024 08:58
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
This adds a unit test workflow and restructures the github workflows
so that we run golangci-lint and unit tests first. Only when they have
succeded will the pipeline continue with e2e tests.
The goal is to conserve resources and avoid running pointless jobs.
The commit also removes unnecessary permissions and avoids running the
jobs if the PR is a draft.

Signed-off-by: Lennart Jern <lennart.jern@est.tech>
@lentzi90 lentzi90 marked this pull request as draft June 5, 2024 09:02
@metal3-io-bot metal3-io-bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@lentzi90 lentzi90 marked this pull request as ready for review June 5, 2024 09:03
@metal3-io-bot metal3-io-bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jun 5, 2024
@metal3-io-bot metal3-io-bot requested a review from zaneb June 5, 2024 09:03
@lentzi90
Copy link
Member Author

lentzi90 commented Jun 5, 2024

/uncc @zaneb @mquhuy @elfosardo @dtantsur @tuminoid @s3rj1k
Sorry for all the review requests. I had to test the "ready for review" functionality by toggling draft multiple times, and each time added more reviewers...

@Rozzii
Copy link
Member

Rozzii commented Jun 5, 2024

/lgtm

@metal3-io-bot metal3-io-bot added the lgtm Indicates that a PR is ready to be merged. label Jun 5, 2024
Copy link
Member

@kashifest kashifest left a comment

Choose a reason for hiding this comment

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

/approve

@metal3-io-bot
Copy link
Contributor

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: kashifest

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:

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

@metal3-io-bot metal3-io-bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jun 5, 2024
@lentzi90
Copy link
Member Author

lentzi90 commented Jun 5, 2024

/cherry-pick release-0.6

@metal3-io-bot
Copy link
Contributor

@lentzi90: once the present PR merges, I will cherry-pick it on top of release-0.6 in a new PR and assign it to you.

In response to this:

/cherry-pick release-0.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

@metal3-io-bot metal3-io-bot merged commit 1dc6694 into metal3-io:main Jun 5, 2024
20 of 21 checks passed
@metal3-io-bot metal3-io-bot deleted the lentzi90/e2e-pipeline branch June 5, 2024 10:00
@metal3-io-bot
Copy link
Contributor

@lentzi90: #1770 failed to apply on top of branch "release-0.6":

Applying: Workflow pipeline with unit tests
Using index info to reconstruct a base tree...
M	.github/workflows/e2e-fixture-test.yml
M	.github/workflows/e2e-test.yml
M	.github/workflows/golangci-lint.yml
Falling back to patching base and 3-way merge...
Auto-merging .github/workflows/golangci-lint.yml
Auto-merging .github/workflows/e2e-test.yml
Removing .github/workflows/e2e-test-pull.yaml
Auto-merging .github/workflows/e2e-fixture-test.yml
CONFLICT (content): Merge conflict in .github/workflows/e2e-fixture-test.yml
error: Failed to merge in the changes.
hint: Use 'git am --show-current-patch=diff' to see the failed patch
Patch failed at 0001 Workflow pipeline with unit tests
When you have resolved this problem, run "git am --continue".
If you prefer to skip this patch, run "git am --skip" instead.
To restore the original branch and stop patching, run "git am --abort".

In response to this:

/cherry-pick release-0.6

Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository.

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. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants