-
Notifications
You must be signed in to change notification settings - Fork 507
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Setup toolchains, compile project with Java 20 only, run test on vari…
…ous Java versions (#2120) * Replace testing on java 19 with testing on java 20 Closes #1888 * Unify `yml` files formating * Do NOT compile the project with various Java version, instead test agains various java verstions https://jakewharton.com/build-on-latest-java-test-through-lowest-java/ * Add `-add-opens` jvmArg to prevent ignored warnings * Migrate away deprecated `java.net.URL` constructor * Setup toolchain resolver If someone doesn't have required java installed Gradle will attempt to install one * Extract common build setup + fix memory settings The build needs less than 0.5GB of a java heap memory. There is no value in reserving more than half of available RAM just for the Gradle demon. It's better to keep Gradle daemon small and leave the memory available to other forked processes (i.e. tests) * Disable VFS on CI CI doesn't modify files, there is no value in putting extra effort in efficiently tracking changed files. From test runs VFS comes with noticable performance impact on Windows build * Update comment with extra clarification * Disable automatic build scans publishing on local builds * Update kotlin dev version * Fix `-PkotlinDev` not running tests agains configured kotlin version * Fix `-PkotlinDev` artifacts version * Run `-PkotlinDev` build as a separate workflow job in parallel Co-authored-by: paul-dingemans <paul-dingemans@users.noreply.github.com>
- Loading branch information
1 parent
3ccdf1f
commit 760279e
Showing
17 changed files
with
206 additions
and
82 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
name: Setup Gradle | ||
description: Sets up the environment to run Gradle | ||
|
||
inputs: | ||
gradle-jvm-args: | ||
description: "JVM args to pass to Gradle" | ||
required: true | ||
# Github-Hosted nodes have only 7GB of RAM available. Looking at build scans Gradle process requires slightly more than 0.5GB. | ||
# Keeping this setting low, allows other, forked JVM processes (like tests) to use remaining memory. | ||
# Increase this value, only if GC time visible in build scans will take more than a few seconds. | ||
default: "-Xmx1g" | ||
additional-java-versions: | ||
description: "Java versions installed on the side of the default Java version required by the build" | ||
required: false | ||
|
||
runs: | ||
using: composite | ||
|
||
steps: | ||
- uses: actions/setup-java@v3 | ||
with: | ||
distribution: 'zulu' | ||
java-version: | # last version (set as default) should match all `jvmToolchain(xxx)` calls in the project | ||
${{ inputs.additional-java-versions }} | ||
20 | ||
# Please note these settings will override the ones set via `gradle.properties` committed to the repository - https://docs.gradle.org/current/userguide/build_environment.html#sec:gradle_configuration_properties | ||
# List of optimizations: | ||
# - `jvm-args` fine-tuned to the CI runner & tasks being invoked | ||
# - disabled File System Watching to improve Windows build times. CI runs don't modify source files, hence they don't need to pay extra cost to efficiently track changed files. | ||
- name: Optimize Gradle build properties for CI | ||
run: | | ||
mkdir -p ~/.gradle | ||
printf "org.gradle.jvmargs=${{ inputs.gradle-jvm-args }}\n" >> ~/.gradle/gradle.properties | ||
printf "org.gradle.vfs.watch=false\n" >> ~/.gradle/gradle.properties | ||
shell: bash | ||
|
||
- uses: gradle/gradle-build-action@v2 | ||
with: | ||
gradle-home-cache-cleanup: true |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
name: "Validate Gradle Wrapper" | ||
|
||
on: [ push, pull_request ] | ||
on: [push, pull_request] | ||
|
||
jobs: | ||
validation: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.