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

Add maven profiles and caching to speed up builds. #1590

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

motlin
Copy link
Contributor

@motlin motlin commented May 21, 2024

I have two changes here:

  • Separating maven plugins into profiles and only enabling the relevant profiles in the relevant workflows
  • Adding the GitHub shared action for caching the .m2 directory

These are only related in that they both are intended to speed up the build and they both were created by comparing with another open source GitHub workflow which is written in this style.

The maven profile thing creates a third related change, splitting the "test" configuration into separate test, enforcer, and dependency:analyze-only jobs.

If this is too much, I can definitely split out the caching, and possibly more.

@motlin motlin force-pushed the maven-profiles-caching branch 3 times, most recently from 3e67bb2 to 77b2a83 Compare May 21, 2024 18:45
@motlin motlin marked this pull request as ready for review May 21, 2024 18:45
@motlin motlin marked this pull request as draft May 21, 2024 22:15
@motlin motlin force-pushed the maven-profiles-caching branch 3 times, most recently from ef16c7b to 2ad4ef3 Compare May 22, 2024 00:14
@@ -468,7 +386,7 @@
<includes>
<include>**/*Test.java</include>
</includes>
<argLine>-XX:-OmitStackTraceInFastThrow -Xms1024m -Xmx2048m @{argLine}</argLine>
<argLine>-XX:-OmitStackTraceInFastThrow -Xms1024m -Xmx2048m --add-opens java.base/java.lang=ALL-UNNAMED @{argLine}</argLine>
Copy link
Contributor Author

Choose a reason for hiding this comment

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

This bit was a surprise to me. Jacoco must have been doing this on our behalf. Without this, unit tests and serialization tests started to fail in Java 17 and higher when calling clone().

@motlin
Copy link
Contributor Author

motlin commented May 22, 2024

Before:
Screenshot 2024-05-21 at 8 42 52 PM

After:

Screenshot 2024-05-21 at 8 43 02 PM

@motlin motlin marked this pull request as ready for review May 25, 2024 12:57
@motlin motlin force-pushed the maven-profiles-caching branch 2 times, most recently from d4ef310 to 731ecbd Compare May 28, 2024 14:12
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.

None yet

1 participant