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

Optimize CI workflow #95

Merged
merged 1 commit into from
May 10, 2023
Merged

Optimize CI workflow #95

merged 1 commit into from
May 10, 2023

Conversation

embano1
Copy link
Member

@embano1 embano1 commented May 9, 2023

Issue #, if available: n/a

Description of changes:

  • Replaces adopt with temurin due to [1]
  • Use matrix strategy testing to simplify the workflow file and allow for extensibility (easily add Java and OS versions)
  • Also test against Java 11 (throws warnings due to 1.8 setting in pom.xml - nothing to worry, unless we want to change the configuration to avoid those)
  • Log maven errors with --errors
  • Uses caching for dependencies to speed up decrease execution times
  • Uses concurrency setting to cancel running workflows when new commits are pushed to the PR (reduce usage/resource waste)
  • Explicitly define permissions for the workflow to reduce attack surface ({} i.e. none)

[1]

NOTE: AdoptOpenJDK got moved to Eclipse Temurin and won't be updated anymore. It is highly recommended to migrate workflows from adopt and adopt-openj9, to temurin and semeru respectively, to keep receiving software and security updates. See more details in the Good-bye AdoptOpenJDK post.

Source: https://github.com/actions/setup-java


By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@embano1 embano1 marked this pull request as ready for review May 9, 2023 07:39
strategy:
matrix:
os: [ ubuntu-20.04 ]
java: [ 8, 11 ]
Copy link
Collaborator

Choose a reason for hiding this comment

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

if its easy to add 17 as well, would love to start running builds against it.

Copy link
Member Author

Choose a reason for hiding this comment

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

Sure, just take a look at the output of 11 though. IMHO there's maven warnings because the pom hardcodes to 1.8 which produces some maven warnings. I'll amend with 17 and you tell me whether that's good.

Copy link
Collaborator

Choose a reason for hiding this comment

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

yup. those are mostly javadoc errors which have a simple fix based on assertj/assertj#1403. I'll look into fixing it tomorrow (unless you beat me to it).

@baldawar
Copy link
Collaborator

baldawar commented May 9, 2023

LGTM @embano1 . Let me know if you'd like me to merge this or hold on for JDK 17 support as well.

Signed-off-by: Michael Gasch <15986659+embano1@users.noreply.github.com>
@baldawar baldawar merged commit aac43ae into aws:main May 10, 2023
baldawar added a commit that referenced this pull request May 15, 2023
These showed up as part of #95

You can see the errors in "Verify with Maven" step in builds
https://github.com/aws/event-ruler/actions/runs/4934093826/jobs/8818724018?pr=95

```
[INFO] --- maven-compiler-plugin:3.11.0:compile (default-compile) @
event-ruler ---
[INFO] Changes detected - recompiling the module! :source
[INFO] Compiling 52 source files with javac [debug target 1.8] to
target/classes
Warning:  bootstrap class path not set in conjunction with -source 8
```

```
Warning:  Javadoc Warnings
Warning: [WARNING] warning: The code being documented uses modules but the
packages defined in https://docs.oracle.com/javase/8/docs/api/ are in the
unnamed module.
Warning:
/home/runner/work/event-ruler/event-ruler/src/main/software/amazon/event/ruler/GenericMachine.java:228:
warning: invalid input: '&'
Warning:  * @param namevals names & values which make up the rule
Warning:  ^
Warning: [WARNING] 2 warnings
```

This change fixes these errors.

 # Please
enter the commit message for your
changes. Lines starting
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.

2 participants