Skip to content

Commit ff9ae24

Browse files
bigdazclaude
andauthored
Add open-source 'basic' cache provider and revamp licensing documentation (#930)
## Summary - **New `basic` cache provider**: Adds an open-source (MIT-licensed) caching implementation built on `@actions/cache` as an alternative to the proprietary Enhanced Caching. Users can opt in with `cache-provider: basic` on both `setup-gradle` and `dependency-submission` actions. - **Revamped licensing & distribution docs**: Replaces the verbose licensing notice block (previously shown in README, docs, and logs) with a friendlier callout and a new dedicated [DISTRIBUTION.md](./DISTRIBUTION.md) covering component licensing, usage tiers, data privacy ("Safe Harbor"), and opt-out instructions. - **Improved messaging**: Enhanced Caching and Basic Caching each display concise, informative log messages and job summary notes instead of the previous wall-of-text license warning. - **New integration tests**: Adds `integ-test-basic-cache-provider.yml` workflow that seeds and verifies the basic cache provider across platforms, plus unit tests for `BasicCacheService` and `getCacheService` selection logic. - **CI workflow reorganization**: Dependency-submission integration tests extracted into their own reusable suite (`suite-integ-test-dependency-submission.yml`); sample project tests moved into the caching suite. 🤖 Generated with [Claude Code](https://claude.com/claude-code) --------- Co-authored-by: Claude Opus 4.6 (1M context) <[email protected]>
1 parent ac396bf commit ff9ae24

23 files changed

Lines changed: 723 additions & 119 deletions

.github/workflows/ci-integ-test-full.yml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,16 @@ jobs:
2424
skip-dist: true
2525
secrets: inherit
2626

27+
dependency-submission-integ-tests:
28+
uses: ./.github/workflows/suite-integ-test-dependency-submission.yml
29+
concurrency:
30+
group: CI-integ-test-full
31+
cancel-in-progress: false
32+
with:
33+
runner-os: '["ubuntu-latest", "windows-latest", "macos-latest"]'
34+
skip-dist: true
35+
secrets: inherit
36+
2737
other-integ-tests:
2838
permissions:
2939
contents: write

.github/workflows/ci-integ-test.yml

Lines changed: 15 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ jobs:
2828
needs: build-distribution
2929
uses: ./.github/workflows/suite-integ-test-caching.yml
3030
concurrency:
31-
group: CI-integ-test
31+
group: CI-integ-test-caching
3232
cancel-in-progress: false
3333
with:
3434
skip-dist: false
@@ -37,10 +37,22 @@ jobs:
3737
other-integ-tests:
3838
permissions:
3939
contents: write
40-
needs: build-distribution
40+
needs: caching-integ-tests
4141
uses: ./.github/workflows/suite-integ-test-other.yml
4242
concurrency:
43-
group: CI-integ-test
43+
group: CI-integ-test-other
44+
cancel-in-progress: false
45+
with:
46+
skip-dist: false
47+
secrets: inherit
48+
49+
dependency-submission-integ-tests:
50+
permissions:
51+
contents: write
52+
needs: other-integ-tests
53+
uses: ./.github/workflows/suite-integ-test-dependency-submission.yml
54+
concurrency:
55+
group: CI-integ-test-dependency-submission
4456
cancel-in-progress: false
4557
with:
4658
skip-dist: false

.github/workflows/demo-job-summary.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,23 @@ jobs:
132132
working-directory: .github/workflow-samples/kotlin-dsl
133133
run: ./gradlew assemble
134134

135+
basic-caching:
136+
needs: build-distribution
137+
runs-on: ubuntu-latest
138+
steps:
139+
- name: Checkout sources
140+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
141+
- name: Initialize integ-test
142+
uses: ./.github/actions/init-integ-test
143+
144+
- name: Setup Gradle
145+
uses: ./setup-gradle
146+
with:
147+
cache-provider: basic
148+
- name: Build kotlin-dsl project
149+
working-directory: .github/workflow-samples/kotlin-dsl
150+
run: ./gradlew assemble
151+
135152
terms-of-use-accepted:
136153
needs: build-distribution
137154
runs-on: ubuntu-latest
Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Test basic cache provider
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
cache-key-prefix:
7+
type: string
8+
default: '0'
9+
runner-os:
10+
type: string
11+
default: '["ubuntu-latest"]'
12+
skip-dist:
13+
type: boolean
14+
default: false
15+
16+
env:
17+
SKIP_DIST: ${{ inputs.skip-dist }}
18+
GRADLE_BUILD_ACTION_CACHE_KEY_PREFIX: basic-cache-provider-${{ inputs.cache-key-prefix }}
19+
20+
permissions:
21+
contents: read
22+
23+
jobs:
24+
basic-cache-seed-build:
25+
strategy:
26+
max-parallel: 1
27+
fail-fast: false
28+
matrix:
29+
os: ${{fromJSON(inputs.runner-os)}}
30+
runs-on: ${{ matrix.os }}
31+
steps:
32+
- name: Checkout sources
33+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
34+
- name: Initialize integ-test
35+
uses: ./.github/actions/init-integ-test
36+
37+
- name: Setup Gradle with basic cache provider
38+
uses: ./setup-gradle
39+
with:
40+
cache-provider: basic
41+
cache-read-only: false # For testing, allow writing cache entries on non-default branches
42+
- name: Build kotlin-dsl project
43+
working-directory: .github/workflow-samples/kotlin-dsl
44+
run: ./gradlew build
45+
46+
basic-cache-verify-build:
47+
needs: basic-cache-seed-build
48+
strategy:
49+
max-parallel: 1
50+
fail-fast: false
51+
matrix:
52+
os: ${{fromJSON(inputs.runner-os)}}
53+
runs-on: ${{ matrix.os }}
54+
steps:
55+
- name: Checkout sources
56+
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
57+
- name: Initialize integ-test
58+
uses: ./.github/actions/init-integ-test
59+
60+
- name: Setup Gradle with basic cache provider
61+
uses: ./setup-gradle
62+
with:
63+
cache-provider: basic
64+
cache-read-only: true
65+
- name: Build kotlin-dsl project
66+
working-directory: .github/workflow-samples/kotlin-dsl
67+
run: ./gradlew build --offline

.github/workflows/suite-integ-test-caching.yml

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,3 +45,21 @@ jobs:
4545
uses: ./.github/workflows/integ-test-restore-java-toolchain.yml
4646
with:
4747
skip-dist: ${{ inputs.skip-dist }}
48+
49+
sample-kotlin-dsl:
50+
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
51+
with:
52+
runner-os: '${{ inputs.runner-os }}'
53+
skip-dist: ${{ inputs.skip-dist }}
54+
55+
sample-gradle-plugin:
56+
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
57+
with:
58+
runner-os: '${{ inputs.runner-os }}'
59+
skip-dist: ${{ inputs.skip-dist }}
60+
61+
basic-cache-provider:
62+
uses: ./.github/workflows/integ-test-basic-cache-provider.yml
63+
with:
64+
runner-os: '${{ inputs.runner-os }}'
65+
skip-dist: ${{ inputs.skip-dist }}
Lines changed: 43 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
name: suite-integ-test-dependency-submission
2+
3+
on:
4+
workflow_call:
5+
inputs:
6+
runner-os:
7+
type: string
8+
default: '["ubuntu-latest"]'
9+
skip-dist:
10+
type: boolean
11+
default: false
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
dependency-graph:
18+
if: ${{ ! github.event.pull_request.head.repo.fork }}
19+
uses: ./.github/workflows/integ-test-dependency-graph.yml
20+
permissions:
21+
contents: write
22+
with:
23+
runner-os: '${{ inputs.runner-os }}'
24+
skip-dist: ${{ inputs.skip-dist }}
25+
26+
dependency-submission:
27+
if: ${{ ! github.event.pull_request.head.repo.fork }}
28+
uses: ./.github/workflows/integ-test-dependency-submission.yml
29+
permissions:
30+
contents: write
31+
with:
32+
runner-os: '${{ inputs.runner-os }}'
33+
skip-dist: ${{ inputs.skip-dist }}
34+
35+
dependency-submission-failures:
36+
if: ${{ ! github.event.pull_request.head.repo.fork }}
37+
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
38+
permissions:
39+
contents: write
40+
with:
41+
runner-os: '${{ inputs.runner-os }}'
42+
skip-dist: ${{ inputs.skip-dist }}
43+

.github/workflows/suite-integ-test-other.yml

Lines changed: 0 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -20,33 +20,6 @@ jobs:
2020
runner-os: '${{ inputs.runner-os }}'
2121
skip-dist: ${{ inputs.skip-dist }}
2222

23-
dependency-graph:
24-
if: ${{ ! github.event.pull_request.head.repo.fork }}
25-
uses: ./.github/workflows/integ-test-dependency-graph.yml
26-
permissions:
27-
contents: write
28-
with:
29-
runner-os: '${{ inputs.runner-os }}'
30-
skip-dist: ${{ inputs.skip-dist }}
31-
32-
dependency-submission:
33-
if: ${{ ! github.event.pull_request.head.repo.fork }}
34-
uses: ./.github/workflows/integ-test-dependency-submission.yml
35-
permissions:
36-
contents: write
37-
with:
38-
runner-os: '${{ inputs.runner-os }}'
39-
skip-dist: ${{ inputs.skip-dist }}
40-
41-
dependency-submission-failures:
42-
if: ${{ ! github.event.pull_request.head.repo.fork }}
43-
uses: ./.github/workflows/integ-test-dependency-submission-failures.yml
44-
permissions:
45-
contents: write
46-
with:
47-
runner-os: '${{ inputs.runner-os }}'
48-
skip-dist: ${{ inputs.skip-dist }}
49-
5023
develocity-injection:
5124
if: ${{ ! github.event.pull_request.head.repo.fork }}
5225
uses: ./.github/workflows/integ-test-inject-develocity.yml
@@ -61,18 +34,6 @@ jobs:
6134
runner-os: '${{ inputs.runner-os }}'
6235
skip-dist: ${{ inputs.skip-dist }}
6336

64-
sample-kotlin-dsl:
65-
uses: ./.github/workflows/integ-test-sample-kotlin-dsl.yml
66-
with:
67-
runner-os: '${{ inputs.runner-os }}'
68-
skip-dist: ${{ inputs.skip-dist }}
69-
70-
sample-gradle-plugin:
71-
uses: ./.github/workflows/integ-test-sample-gradle-plugin.yml
72-
with:
73-
runner-os: '${{ inputs.runner-os }}'
74-
skip-dist: ${{ inputs.skip-dist }}
75-
7637
toolchain-detection:
7738
uses: ./.github/workflows/integ-test-detect-toolchains.yml
7839
with:

CLAUDE.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,12 @@ Do not treat `actions/sources/vendor/gradle-actions-caching` as the source of tr
1717

1818
## Building
1919

20+
Before running any build or npm commands, initialize the PATH:
21+
22+
```sh
23+
source ~/.zshrc
24+
```
25+
2026
To build this repository, run the `build` script at the root of that repository with no arguments:
2127

2228
```sh

DISTRIBUTION.md

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
# Distribution and Licensing of gradle/actions
2+
3+
This document provides a clear breakdown of the components within the `gradle/actions` repository, their respective licenses, and how we handle data and privacy. Our goal is to provide the best possible experience for running Gradle on GitHub Actions while maintaining our commitment to the open-source community.
4+
5+
## 1. Component Map
6+
The `gradle/actions` project consists of three primary components:
7+
8+
| Component | License | Source | Description |
9+
| :--- | :--- | :--- | :--- |
10+
| **Action Runner** | **[MIT](LICENSE)** | Open | The core action logic: configures a local Gradle installation, performs wrapper validation, and reports on Gradle build execution. |
11+
| **Basic Caching** | **[MIT](LICENSE)** | Open | Configures basic Gradle User Home caching using 'actions/cache'. |
12+
| **Enhanced Caching** | **[Proprietary](NOTICE)** | Closed | Uses the 'gradle-actions-caching' library to provide fine-grained caching of Gradle User Home, intelligent cache cleanup and other advanced features. |
13+
14+
By default, **Enhanced Caching** is enabled to provide the best experience.
15+
16+
## 2. The "Safe Harbor" Clause (Data Privacy)
17+
The proprietary components of this action are governed by the **[Gradle Technologies Terms of Use](https://gradle.com/legal/gradle-technologies-terms-of-use/)**. We have updated these terms to include a specific safe harbor for users of `gradle-actions-caching`.
18+
19+
> **Plain English Summary:** Gradle does not claim ownership of any code, build artifacts, or other content processed by the caching library. These remain your sole property. We only use metadata (like cache keys) to facilitate the caching service.
20+
21+
## 3. Usage Tiers
22+
To support the development of high-performance CI tooling, we offer the following usage model:
23+
24+
* **Public Repositories:**
25+
* Both **Basic** and **Enhanced** caching are free forever. We are committed to supporting the open-source ecosystem at no cost.
26+
* **Private Repositories:**
27+
* **Basic Caching** is free forever under the MIT license.
28+
* **Enhanced Caching** is currently in a **Free Preview** phase. We plan to introduce usage-based pricing for large-scale commercial organizations in the future.
29+
30+
While we haven't finalized specific usage thresholds yet, our intent is to keep Enhanced Caching free for individual developers and small teams. We are currently in a learning phase to ensure that future restrictions are focused on large-scale commercial users of the product. No matter how these limits evolve, the open-source Basic Caching provider will always remain a free, functional alternative for everyone.
31+
32+
## 4. Your Choice: Basic vs. Enhanced
33+
We believe in user autonomy. If you do not wish to use proprietary code or accept the Gradle Technologies Terms of Use, you can opt-out of enhanced caching with a single line of configuration:
34+
35+
```yaml
36+
- uses: gradle/actions/setup-gradle@v6
37+
with:
38+
cache-provider: basic # Switches to the MIT-licensed open-source implementation
39+
```
40+
41+
> [!IMPORTANT]
42+
> ## Licensing notice
43+
>
44+
> The software in this repository, except for the bundled `gradle-actions-caching` component, is licensed under the [MIT License](LICENSE).
45+
>
46+
> The caching functionality in this project has been extracted into `gradle-actions-caching`, a proprietary commercial component that is not covered by the MIT License for this repository.
47+
>
48+
> Use of the `gradle-actions-caching` component is subject to a separate license, available at https://gradle.com/legal/terms-of-use/.
49+
>
50+
> The `gradle-actions-caching` component is used only when enhanced caching is enabled and is not loaded or used with basic caching or when caching is disabled.

LICENSE

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,14 @@
1+
Note on Repository Contents:
2+
3+
The software in this repository is primarily licensed under the MIT License (see below).
4+
However, this repository includes a vendor-included component, 'gradle-actions-caching',
5+
which is Proprietary and subject to the Gradle Technologies Terms of Use
6+
(https://gradle.com/legal/gradle-technologies-terms-of-use/).
7+
8+
For a detailed breakdown of which components are Open Source (MIT) and which are
9+
Proprietary, please refer to DISTRIBUTION.md and NOTICE.
10+
11+
-------------------------------------------------------------------------
112

213
The MIT License (MIT)
314

0 commit comments

Comments
 (0)