Update 'all tests' GitHub action, enable Gradle Build Cache #862
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains some proposals for improving the 'all tests' GitHub action. I hope to make them faster.
I'm making a PR before an issue to test/demo that it works as intended :)
Only test LTS JDK versions (11, 17), plus the latest version (18 at the moment - this can change more frequently). I'm making an assumption here that there's not going to be major differences between the non-LTS versions, and even if there are, as far as I know they're not well supported.
Reducing the number of versions improves the actions speed, as I think there's a limit on how many jobs can run in parallel.
Add 'concurrency'. I've noticed when I've pushed a few changes in rapid succession, each change will be tested. This isn't necessary - the tests should be cancelled and restarted if there's a newer commit.
I copied the concurrency config from here: https://docs.github.com/en/actions/examples/using-concurrency-expressions-and-a-test-matrix#understanding-the-example
I bumped Kotlin 1.6.0 to 1.6.21. It seemed odd that 1.5 and 1.7 were on the latest version, but 1.6 wasn't.
I updated the Gradle caching, copied from
https://github.com/JetBrains/intellij-platform-plugin-template/actions/runs/242898088/workflow#L46-L58
This means the cache key is less specific (I think sharing the Gradle cache between Kotlin & JVM versions is fine, Gradle will rebuild/reuse tasks if necessary), and the wrapper and dependencies are cached separately (if the dependencies change, the wrapper can still be cached)
I enabled Gradle Build cache. This should really help build speeds.