forked from elastic/elasticsearch
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[Gradle] Add buildkite ci validation script for configuration cache (e…
…lastic#110269) We see gradle cache incompatibilities sneaking into our code base. Until we can enable this feature by default we should regular run checks existing configuration cache achievements are not degrading. This change includes: - updating spotless gradle plugin to configuration cache compatible version (its still BETA but imo good enough for our needs)
- Loading branch information
Showing
5 changed files
with
48 additions
and
6 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
27 changes: 27 additions & 0 deletions
27
.buildkite/scripts/gradle-configuration-cache-validation.sh
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,27 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
|
||
# TODO/ FIXIT without a full resolved gradle home, we see issues configuration cache reuse | ||
./gradlew --max-workers=8 --parallel --scan --no-daemon precommit | ||
|
||
./gradlew --max-workers=8 --parallel --scan --configuration-cache precommit -Dorg.gradle.configuration-cache.inputs.unsafe.ignore.file-system-checks=build/*.tar.bz2 | ||
|
||
# Create a temporary file | ||
tmpOutputFile=$(mktemp) | ||
trap "rm $tmpOutputFile" EXIT | ||
|
||
echo "2nd run" | ||
# TODO run-gradle.sh script causes issues because of init script handling | ||
./gradlew --max-workers=8 --parallel --scan --configuration-cache precommit -Dorg.gradle.configuration-cache.inputs.unsafe.ignore.file-system-checks=build/*.tar.bz2 | tee $tmpOutputFile | ||
|
||
# Check if the command was successful | ||
if grep -q "Configuration cache entry reused." $tmpOutputFile; then | ||
echo "Gradle configuration cache reused" | ||
exit 0 | ||
else | ||
echo "Failed to reuse Gradle configuration cache." | ||
exit 1 | ||
fi | ||
|
||
|
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