Commit graph

79 commits

Author SHA1 Message Date
Daz DeBoer
f4e053dda1
Upgrade to reference actions/setup-java@v2
- Update all references in README.md
- Update version used in `pr-build-scan-comment`
- Discourage the use of `cache: gradle` with `setup-java@v2`
2022-01-16 16:18:09 -07:00
Benedikt Ritter
a7c463b44a
Update to latest version of actions/github-script
See https://github.com/marketplace/actions/github-script#breaking-changes-in-v5

* Update docs to latest github-script action version
* Update CI build to latest GitHub API
2022-01-16 15:45:15 -07:00
Daz DeBoer
76ea8a76b2
Treat configuration-cache as an extracted entry
Instead of using a fallback strategy to locate a configuration-cache entry
based on the current job and git SHA, these entries are now keyed based on their
file content with the keys persisted in the primary Gradle User Home entry.

This removes the chance of having a configuration-cache entry restored that is
incompatible with the restored Gradle User Home state, and makes the logic easier
to understand.

This change involved a fairly major refactor, with the CacheEntryExtractor being
split out from the primary cache implementation, and adding a separate extractor
implementation for configuration-cache.
2021-12-30 16:03:02 -07:00
Daz DeBoer
12fc52a49a
Combine java-toolchain entry definitions
- Remove configuration parameter for cache-entry-definitions. This allows richer modelling of extracted entries.
- Include both *.zip and *.tar.gz in entry definition for java-toolchains.
2021-12-30 16:03:02 -07:00
Daz DeBoer
c61f5d87b4
Test java-toolchain cache 2021-12-17 21:10:31 -07:00
Daz DeBoer
c208b4c1f7
Test caching with gradle-plugin project 2021-12-17 20:54:04 -07:00
Daz DeBoer
eda0038770
Reduce the number of automated comments left on PR 2021-12-17 10:49:41 -07:00
Daz DeBoer
ed5b4ae5dc
Verify GUH restore combined with Gradle execution 2021-12-17 10:44:29 -07:00
Daz DeBoer
e977669c8c
Update most test workflows to separate config from execution 2021-12-17 10:29:59 -07:00
Daz DeBoer
69aad1f173
Test config-cache support for multiple builds in one job 2021-12-08 15:09:26 -07:00
Daz DeBoer
f344e25b84
Attempt to reduce duplicate workflows on PR creation 2021-12-08 14:20:13 -07:00
Daz DeBoer
37f2880a8a Cache wrapper zips and generated jars individually
Using a single cache entry for all files of a type is necessary to avoid
overloading the cache service. However, this mechanism is not very efficient
for certain artifacts like wrapper zips and generated-gradle-jars, where the
same individual files are often shared between different jobs.

With this change, any configured file patterns that do not end in '*' will
be cached as individual files. At this time this includes downloaded wrapper
zips and generated-gradle-jars.

Fixes #78
2021-12-08 14:05:13 -07:00
Daz DeBoer
aa9bf7774e
Add build-scan comment to any PRs 2021-12-08 13:07:51 -07:00
Daz DeBoer
ed2ff1a448
Use a matrix for testing Gradle versions 2021-12-08 10:04:24 -07:00
Jonathan Leitschuh
3812292b26
Add CodeQL Analysis (#114) 2021-11-02 09:56:02 -06:00
Daz DeBoer
079e4844d6
Split tests for caching
- Separate testing of Gradle Home caching from configuration-cache caching
- Add test for configuration-cache when Gradle Home is not fully restored
2021-10-29 09:34:35 -06:00
Daz DeBoer
4ebd000afd
Bundle all downloaded dependency files
Previously, only .jar files were bundled, with other files (modules, POMs, zips, etc)
being left in Gradle User Home. All downloaded files are now included in the bundle.

Fixes #100
2021-10-29 08:03:03 -06:00
Daz DeBoer
e3ada7e5c2
Use multiline input parameters instead of JSON input
The `gradle-home-cache-includes` and `gradle-home-cache-excludes` parameters were initially implemented
as JSON string inputs. This makes these inputs non-idiomatic and easier to get wrong.

This change converts them to multi-line input parameters.

Fixes #106
2021-10-29 07:29:57 -06:00
Daz DeBoer
0eb881f067
Adapt workflows to renamed parameters 2021-10-27 16:07:24 -06:00
Daz DeBoer
cba1833dde
Run test builds on Ubuntu and Windows
- Remove MacOS since the agents are current flaky
- Add Windows to a few more test pipelines
2021-10-21 12:08:17 -06:00
Daz DeBoer
614d8770a4
Add test for cache configuration 2021-10-21 11:13:09 -06:00
Daz DeBoer
8b1f1a3817
Add test for execution when no bundles are restored 2021-10-15 13:29:09 -06:00
Daz DeBoer
d1ab42cddf
Document support for multi-line arguments
Fixes #88
2021-10-15 12:24:41 -06:00
Daz DeBoer
422726cec5
Add test for multi-line input arguments 2021-10-15 12:20:01 -06:00
Daz DeBoer
0cf00ed767
Fix test for release-candidate
Since this is an ever-changing version, this fix removes the `gradleVersionCheck` from the invocation.
2021-10-14 10:48:44 -06:00
Daz DeBoer
6ff498182a
Add checks for build scan links 2021-09-29 15:10:39 -06:00
Daz DeBoer
9b7c81f8f6
Test execution with older Gradle versions 2021-09-29 13:34:05 -06:00
Daz DeBoer
17f624cb5b
Rename 'basic' sample to 'groovy-dsl' 2021-09-28 20:31:11 -06:00
Daz DeBoer
5576baa56b
Merge pull request #83 from gradle/dd/v2
Adapt paths to differing Gradle User Home
2021-09-27 22:08:40 -06:00
Daz DeBoer
1026c62889
Only run failure-cases workflow on manual trigger 2021-09-27 22:05:23 -06:00
Daz DeBoer
e0d37eb073
Workflow to test with custom GRADLE_USER_HOME 2021-09-27 19:48:26 -06:00
Daz DeBoer
bdd89aa34f
Refactored workflows
- Improve workflow names
- Split execution testing from cache testing
2021-09-27 19:33:22 -06:00
Daz DeBoer
656ad4b5f2
Move continue-on-error into the step definition
Hopefully this will allow GitHub to ignore the failure.
2021-09-15 17:57:43 -06:00
Daz DeBoer
cca55d0890
Fail action execution on unhandled errors
Without this, the error logs contain an "UnhandledPromiseRejectionError"
but the action is reported as succeeding.
2021-09-14 07:48:06 -06:00
Daz DeBoer
3390540145
Simplify setting caches to disabled or read-only 2021-09-13 11:04:42 -06:00
Daz DeBoer
1c72a31463
Allow cache debug logging to be selectively enabled
- Move more messages out of main 'info' log
- Only log cache entry size when debugging
- Process cache entries sequentially when debugging
2021-09-13 10:52:09 -06:00
Daz DeBoer
d5cd9d86a1
Split the 'prod' workflow up into different isolated workflows
This is required to ensure that cache entries are namespaced correctly
for the integration tests.
2021-09-12 12:17:05 -06:00
Daz DeBoer
b5a08466b4
Add kotlin-dsl sample to prod workflow tests 2021-09-12 10:30:49 -06:00
Daz DeBoer
4d37378696
Consolidate cache-enabled options 2021-09-05 21:38:33 -06:00
Daz DeBoer
777a6fc967
Generate cache key based on Job invocation
Attempt to capture as much context as possible about the job run
to generate a unique cache key. Unfortunately much of the matrix context
is not available to the action implementation.
2021-09-05 21:35:17 -06:00
Daz DeBoer
436390bd4e
Test coverage: Verify configuration-cache is restored with project-dot-gradle 2021-08-27 12:53:02 -06:00
Daz DeBoer
a587e93714
Test coverage: Verify local build cache is restored with gradle-user-home 2021-08-27 12:53:02 -06:00
Daz DeBoer
75e00ee3d1
Test coverage: Verify dependency caching by running offline build 2021-08-27 12:53:02 -06:00
Daz DeBoer
c01af7a6f6
Test coverage: verify correct Gradle version is being used 2021-08-27 12:53:02 -06:00
Daz DeBoer
b85ac67c9a
Seed the cache key with workflow id in CI
This will eliminate cache entries from previous workflow runs, allowing
us to test cache functionality in isolation. If the `CACHE_KEY_SEED` environment
variable is not set, this will have no impact.
2021-08-27 12:52:01 -06:00
Daz DeBoer
fa0c026e07
Always execute Gradle with --no-daemon
The Gradle daemon is not useful for ephemeral builds, and the process
can hold file locks which interfere with cache entry generation.

In the case where multiple Gradle invocations occur in the same job,
we could provide a way for users to override this behaviour, taking care
of stopping any daemon process at the end of the job.
2021-08-27 12:21:46 -06:00
Daz DeBoer
986024f0b7
Adapt README and workflow for new caching 2021-08-26 17:25:50 -06:00
Daz DeBoer
d9cc0aeccf
Remove old caching code 2021-08-24 12:54:21 -06:00
Daz DeBoer
a148b21183
Improve prod workflow
- Use a separate job to test read-only cache
- Use dependency jobs to avoid cache race conditions
2021-08-22 14:42:01 -06:00
Daz DeBoer
a693ccda4b
Allow use of caches 'read-only'
To avoid evicting useful entries, some pipeline may benefit from using existing
cache entries without writing any changes back to the cache.

Fixes #62
2021-08-22 14:28:34 -06:00