-
Notifications
You must be signed in to change notification settings - Fork 26
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
Found a possibility of limiting the Linux build only for the 24.0.9 LTI version #1218
base: main
Are you sure you want to change the base?
Found a possibility of limiting the Linux build only for the 24.0.9 LTI version #1218
Conversation
Build Resullts example : https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12704625074 https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12704635529 https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12705078967 NOTE: You can see that for the LTI tag 24.0.9, both Windows and Mac have green builds because all the steps were skipped. For the 24.0.12 LTI tag, I haven't created the tag in my fork, which caused the failure in the checkout step. We can ignore it for now, and it will run on the remote repository. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we just exclude the windows and mac matrix instead so that the condition doesn't need to be checked in every step?
Hi @anusreelakshmi934 and @TrevCraw , https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12742932719 -> Normal Build https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12742954503 -> Cron Job builds NOTE: Only linux os is listed in the 24.0.9 LTI tag builds and you can see the change in name due to matrix constraints, please let me know the suggestions if any, |
.github/workflows/build.yaml
Outdated
os: macOS-latest | ||
reportName: mac-test-report | ||
- runtime: windows | ||
os: [ ubuntu-latest, macOS-latest, windows-latest ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason the matrix needed to be changed up? Could we not just exclude runtime: windows
or runtime: mac
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @TrevCraw ,I tried keeping the runtime
, but I am getting the error below because I am using exclude
to limit the OS for 24.0.9
.
https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12761300513
I tried using both include
(the code currently in the main branch) and exclude
(by keeping runtime), but the logic for running 24.0.9 LTI on Linux only is failing, and in some cases, I am encountering other errors as well.
https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12761891237
NOTE: So, if we are using exclude, the key should be the same as the matrix name.
Based on the error, I tried adding os
to the matrix, but this resulted in an increased number of builds (combining both runtime
matrix and OS
matrix). This is not desirable for Normal
and Cron Job
builds.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@TrevCraw , I tried a different approach today that is working fine by keeping the runtime: mac
. This allows adding multiple OS options anytime by giving them different names and assigning unique names to the artifacts (both zip and test-reports)
I would also recommend updating the cron job documentation here - https://github.com/OpenLiberty/liberty-tools-intellij/blob/main/docs/LSP4IJ-Continuous-Integration.md#results-from-the-cron-job - to state what the |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
See review comments.
.github/workflows/build.yaml
Outdated
os: macOS-latest | ||
reportName: mac-test-report | ||
- runtime: windows | ||
os: [ ubuntu-latest, macOS-latest, windows-latest ] |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In the past if we wanted to run Mac twice we could just add "mac1, mac2" to the matrix.runtime. With this change it doesn't look like we can do that anymore. Can you provide instructions how to run a test multiple times or put the matrix back the way it was?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes @turkeylurkey , You can add multiple OS options to the OS matrix as shown below without making any other changes.
os: [ ubuntu-latest, macOS-latest, windows-latest, ubuntu-latest, macOS-latest, windows-latest ]
NOTE: Make sure to add only the OS, not the runtime, as I removed the runtime due to the use of exclude
.
Normal build Screenshot
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will the test report names collide?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes you are correct @turkeylurkey , I tried a different approach today that is working fine. This allows adding multiple OS options anytime by giving them different names and assigning unique names to the artifacts (both zip and test-reports)
For example
jobs:
build:
name: build ( ${{ matrix.runtime.name }}, ${{ matrix.excludeLTITag }} )
runs-on: ${{ matrix.runtime.os }}
strategy:
fail-fast: false
matrix:
runtime:
- name: linux-1
os: ubuntu-latest
reportName: linux-test-report-1
- name: mac-1
os: macOS-latest
reportName: mac-test-report-1
- name: windows-1
os: windows-latest
reportName: windows-test-report-1
- name: linux-2
os: ubuntu-latest
reportName: linux-test-report-2
- name: mac-2
os: macOS-latest
reportName: mac-test-report-2
- name: windows-2
os: windows-latest
reportName: windows-test-report-2
excludeLTITag:
- ${{ inputs.refLTITag == '24.0.9' }}
exclude:
- excludeLTITag: true
runtime:
name: mac-1
- excludeLTITag: true
runtime:
name: mac-2
- excludeLTITag: true
runtime:
name: windows-1
- excludeLTITag: true
runtime:
name: windows-2
please check the build results to verify.
Latest build results: https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12782956248 -Cron Job build https://github.com/vaisakhkannan/liberty-tools-intellij/actions/runs/12783668287 -> Multiple OS Normal build |
Fixes #1217
This fix added a check (based on the value 'excludeLTITag') on macOS and Windows to verify if 'refLTITag' is equal to '24.0.9'. The value of 'excludeLTITag' is used to determine whether the Job
build
need to be executed. This 'excludeLTITag' variable can be removed once the '24.0.9' version is removed from the 'tag' array of the cron job build.But it is not necessary. That means, If we remove 24.0.9 from the LTI tags in the
cronJob.yaml
file, there is no need to modify anything in thebuild.yaml
file. The variableexcludeLTITag
will calculate its value and will returnfalse
always since it not there inLTI
tag. This ensures it works as expected for bothnormal
andcron job
builds.I tried this solution to make changes in the
build.yaml
file without using the if condition for all steps in the job. By calculating the filtering of the OS based on the LTI tag24.0.9
at the matrix level, this fix becomes more feasible.