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

[issue-1272] GitHub action setup #1304

Merged
merged 3 commits into from
Apr 25, 2024
Merged

Conversation

gaol
Copy link
Collaborator

@gaol gaol commented Apr 23, 2024

Fixes #1272

  • Based on Jim's initial github action setup from Initial change to start the github action build Initial change to start the github action build  #1274
  • Check changes to main branch only and ignore changes in non code paths
  • Check unit tests only for now. ./mvnw clean package

@gaol gaol force-pushed the github_action_setup branch from 1a9f7b4 to ee42828 Compare April 24, 2024 03:56
@gaol gaol marked this pull request as ready for review April 24, 2024 03:57
@gaol
Copy link
Collaborator Author

gaol commented Apr 24, 2024

@jimma @fabiobrz may I ask you to review ? thanks ! This will enable github action just like what .circleci does now for the unit tests. The integration tests will be fixed by following up issues, and once they are done, the github action will be updated to cover integration tests as well.

.github/workflows/maven.yml Outdated Show resolved Hide resolved
@gaol gaol changed the title GitHub action setup [issue-1272] GitHub action setup Apr 24, 2024
strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
Copy link
Contributor

Choose a reason for hiding this comment

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

I am not sure we need to create a platform matrix as this will require linux containers, so this won't ever work on windows and probably neither on macos.

Copy link
Contributor

Choose a reason for hiding this comment

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

i.e. I would just do runs-on: ubuntu-latest and move on

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

got it !

Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess matrix aims at supporting more than just one JDK, as it was in the initial PR: https://github.com/arquillian/arquillian-cube/pull/1274/files#diff-5dbf1a803ecc13ff945a08ed3eb09149a83615e83f15320550af8e3a91976446R19

But just my take.
A question, though: wouldn't be better to have them working on linux and file a separate tracker for expanding? Short living (hopefully) and easy to review PRs would be the reason.
WDYT?

Copy link
Contributor

Choose a reason for hiding this comment

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

JDK matrix for sure - but os matrix not really useful.

Copy link
Collaborator

@fabiobrz fabiobrz left a comment

Choose a reason for hiding this comment

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

Hi @gaol - and thanks for this PR.
I dropped some minor comments, and I'd like to know whether we do have some run reference for the action we are implementing: maybe here? https://github.com/gaol/arquillian-cube/actions

WDYT?

driver: docker
container runtime: containerd
minikube version: 'v1.30.1'
kubernetes version: 'v1.27.1'
Copy link
Collaborator

Choose a reason for hiding this comment

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

Just asking whether we'd want to use the latest K8s minor, or at least micro? See https://kubernetes.io/releases/

Or is there a reason for referencing 1.27.1?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sure, we can use the latest version I guess. It was there from original PR. will update it to 1.30.0 which is the latest one I can see. also I will update the actions-setup-minikube to latest one to support it.

strategy:
fail-fast: false
matrix:
os: [ubuntu-latest]
Copy link
Collaborator

Choose a reason for hiding this comment

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

I guess matrix aims at supporting more than just one JDK, as it was in the initial PR: https://github.com/arquillian/arquillian-cube/pull/1274/files#diff-5dbf1a803ecc13ff945a08ed3eb09149a83615e83f15320550af8e3a91976446R19

But just my take.
A question, though: wouldn't be better to have them working on linux and file a separate tracker for expanding? Short living (hopefully) and easy to review PRs would be the reason.
WDYT?

@gaol
Copy link
Collaborator Author

gaol commented Apr 24, 2024

I'd like to know whether we do have some run reference for the action we are implementing: maybe here? https://github.com/gaol/arquillian-cube/actions

WDYT?

Yes, there is: https://github.com/gaol/arquillian-cube/tree/github_action_setup_own_test, which is the place I test the github action execution.

wouldn't be better to have them working on linux and file a separate tracker for expanding? Short living (hopefully) and easy to review PRs would be the reason.

Sure, now the plan is to stay with runs-on: ubuntu-latest, and having the jdk matrix to 11 only, we can expand to more jdk versions later.

@fabiobrz
Copy link
Collaborator

fabiobrz commented Apr 24, 2024

Yes, there is: https://github.com/gaol/arquillian-cube/tree/github_action_setup_own_test, which is the place I test the github action execution.

Thanks @gaol - Ok, so we'd have to wait for a green bar there, right? IIUC the last commit is failing the CI checks: https://github.com/gaol/arquillian-cube/actions/runs/8814197921/job/24193526839

@gaol
Copy link
Collaborator Author

gaol commented Apr 24, 2024

yes, @fabiobrz , I think there is a temporary failure (failed with apt-get update -y), will re-run it later and comment here once I get green result.

@gaol gaol force-pushed the github_action_setup branch from 8239bb1 to 0c6b317 Compare April 24, 2024 14:18
@gaol
Copy link
Collaborator Author

gaol commented Apr 24, 2024

Updated according to the feed backs:

  • only use runner: ubuntu-latest
  • jdk matrix is 11 for now
  • minikube version: v1.32.0 for manusa/actions-setup-minikube@v2.10.0
  • kubernetes version: v1.30.0 for manusa/actions-setup-minikube@v2.10.0

The reference github action execution is: https://github.com/gaol/arquillian-cube/actions/runs/8818141575/job/24206240475

@fabiobrz @rhusar

fabiobrz
fabiobrz previously approved these changes Apr 24, 2024
Copy link
Collaborator

@fabiobrz fabiobrz left a comment

Choose a reason for hiding this comment

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

Unit tests in the K8s category are executed and passing along with the Docker ones. I am approving, let's expand to ITs and OpenShift from here. Thanks @gaol !

I'll merge this once @rhusar will approve too.

Copy link
Contributor

@rhusar rhusar left a comment

Choose a reason for hiding this comment

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

Few more things.

@@ -0,0 +1,74 @@
name: Arquillian-Cube Maven Build
Copy link
Contributor

@rhusar rhusar Apr 24, 2024

Choose a reason for hiding this comment

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

Please drop the dash, the project name is "Arquillian Cube" (no dash).

Nevertheless I always struggle how to name these. The project name seems redundant. The maven build is also redundant, since that's the only build system we use here. Also, build is a bit of a misnomer as primarily this is used to testing...

- uses: actions/upload-artifact@v3
if: failure()
with:
name: server-logs-${{ matrix.os }}-${{ matrix.java }}
Copy link
Contributor

Choose a reason for hiding this comment

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

The ${{ matrix.os }} would fail to resolve now.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

right !

- uses: actions/upload-artifact@v3
if: failure()
with:
name: surefire-reports-${{ matrix.os }}-${{ matrix.java }}
Copy link
Contributor

Choose a reason for hiding this comment

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

The ${{ matrix.os }} would fail to resolve now.

Comment on lines 67 to 70
- uses: actions/upload-artifact@v3
if: failure()
with:
name: server-logs-${{ matrix.os }}-${{ matrix.java }}
Copy link
Contributor

Choose a reason for hiding this comment

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

Also any reason why this action is duplicated? I would just collect this in one zip with multiple paths.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

They are different artifacts, one is all from target/urefire-reports/, the other is from all *.log files, the 2 artifacts separate the information. but I think it is fine as well to zip all into one artifact.

gaol added 2 commits April 25, 2024 12:19
* Monitor changes on main branch
* Ignore changes in non-code paths
* Specify env FAILSAFE_GROUPS to run group of tests
* Pre fetch dependnecies in Maven build
* Check unit tests only for now
@gaol
Copy link
Collaborator Author

gaol commented Apr 25, 2024

@rhusar thanks, fixed as the following:

  • Rename the workflow name to Arquillian Cube Test, please feel free to propose new names if you like.
  • Combine all log files and surefire-reports files into one artifact to upload on failure.
  • Drop the use of matrix.os

The last execution is: https://github.com/gaol/arquillian-cube/actions/runs/8826949457/job/24233479032

Copy link
Contributor

@rhusar rhusar 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, thanks!

@fabiobrz fabiobrz merged commit 2dac962 into arquillian:main Apr 25, 2024
1 check passed
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.

[TASK]:Add github action workflow yml to build
4 participants