Skip to content

Commit 9789f85

Browse files
authored
Build: Designate a single Gradle cache writer across CI workflows (#16356)
1 parent 6976e02 commit 9789f85

12 files changed

Lines changed: 48 additions & 0 deletions

.github/workflows/api-binary-compatibility.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -60,6 +60,9 @@ jobs:
6060
distribution: zulu
6161
java-version: 17
6262
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
63+
with:
64+
# Read-only: small job; restore opportunistically from other jobs' caches but never write.
65+
cache-read-only: true
6366
- run: |
6467
echo "Using the old version tag, as per git describe, of $(git describe)";
6568
- run: ./gradlew revapi --rerun-tasks

.github/workflows/cve-scan.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -127,6 +127,9 @@ jobs:
127127
distribution: zulu
128128
java-version: 21
129129
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2 # zizmor: ignore[cache-poisoning] -- cache writes are restricted to the default branch by setup-gradle
130+
with:
131+
# Read-only: small job; restore opportunistically from other jobs' caches but never write.
132+
cache-read-only: true
130133
- name: Build ${{ matrix.distribution }}
131134
run: |
132135
./gradlew -DsparkVersions= -DflinkVersions= \

.github/workflows/delta-conversion-ci.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -90,6 +90,9 @@ jobs:
9090
distribution: zulu
9191
java-version: ${{ matrix.jvm }}
9292
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
93+
with:
94+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
95+
cache-read-only: true
9396
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
9497
- run: ./gradlew -DsparkVersions=3.5 -DscalaVersion=2.12 -DkafkaVersions= -DflinkVersions= :iceberg-delta-lake:check -Pquick=true -x javadoc
9598
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -116,6 +119,9 @@ jobs:
116119
distribution: zulu
117120
java-version: ${{ matrix.jvm }}
118121
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
122+
with:
123+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
124+
cache-read-only: true
119125
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
120126
- run: ./gradlew -DsparkVersions=3.5 -DscalaVersion=2.13 -DkafkaVersions= -DflinkVersions= :iceberg-delta-lake:check -Pquick=true -x javadoc
121127
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

.github/workflows/flink-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -94,6 +94,9 @@ jobs:
9494
distribution: zulu
9595
java-version: ${{ matrix.jvm }}
9696
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
97+
with:
98+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
99+
cache-read-only: true
97100
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
98101
- run: ./gradlew -DsparkVersions= -DkafkaVersions= -DflinkVersions=${{ matrix.flink }} :iceberg-flink:iceberg-flink-${{ matrix.flink }}:check :iceberg-flink:iceberg-flink-runtime-${{ matrix.flink }}:check -Pquick=true -x javadoc -DtestParallelism=auto
99102
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

.github/workflows/hive-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ jobs:
9191
distribution: zulu
9292
java-version: ${{ matrix.jvm }}
9393
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
94+
with:
95+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
96+
cache-read-only: true
9497
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
9598
- run: ./gradlew -DsparkVersions= -DflinkVersions= -DkafkaVersions= -Pquick=true :iceberg-mr:check -x javadoc
9699
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1

.github/workflows/java-ci.yml

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -86,6 +86,9 @@ jobs:
8686
distribution: zulu
8787
java-version: ${{ matrix.jvm }}
8888
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
89+
with:
90+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
91+
cache-read-only: true
8992
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
9093
- run: ./gradlew check -DsparkVersions= -DflinkVersions= -DkafkaVersions= -Pquick=true -x javadoc
9194
- uses: actions/upload-artifact@043fb46d1a93c77aae656e7c1c64a875d1fc6a0a # v7.0.1
@@ -110,6 +113,9 @@ jobs:
110113
distribution: zulu
111114
java-version: ${{ matrix.jvm }}
112115
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
116+
with:
117+
# Writes cache on main; read-only otherwise.
118+
cache-read-only: ${{ !(github.ref == 'refs/heads/main' && matrix.jvm == 17) }}
113119
- run: ./gradlew -DallModules build -x test -x javadoc -x integrationTest
114120

115121
build-javadoc:
@@ -127,6 +133,9 @@ jobs:
127133
distribution: zulu
128134
java-version: ${{ matrix.jvm }}
129135
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
136+
with:
137+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
138+
cache-read-only: true
130139
- run: ./gradlew -Pquick=true javadoc
131140

132141
check-runtime-deps:
@@ -140,4 +149,7 @@ jobs:
140149
distribution: zulu
141150
java-version: 17
142151
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
152+
with:
153+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
154+
cache-read-only: true
143155
- run: ./gradlew checkAllRuntimeDeps -q -DallModules=true

.github/workflows/jmh-benchmarks.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -104,6 +104,9 @@ jobs:
104104
distribution: zulu
105105
java-version: 17
106106
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
107+
with:
108+
# Disabled: dispatched against arbitrary repo/ref inputs; never restore or write to avoid cache poisoning.
109+
cache-disabled: true
107110
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
108111

109112
- name: Run Benchmark

.github/workflows/kafka-connect-ci.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,9 @@ jobs:
9191
distribution: zulu
9292
java-version: ${{ matrix.jvm }}
9393
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
94+
with:
95+
# Read-only: java-ci's build-checks (17) is the global canonical writer.
96+
cache-read-only: true
9497
- run: echo -e "$(ip addr show eth0 | grep "inet\b" | awk '{print $2}' | cut -d/ -f1)\t$(hostname -f) $(hostname -s)" | sudo tee -a /etc/hosts
9598
- run: |
9699
./gradlew -DsparkVersions= -DflinkVersions= -DkafkaVersions=3 \

.github/workflows/publish-iceberg-rest-fixture-docker.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,9 @@ jobs:
4949
distribution: zulu
5050
java-version: 21
5151
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
52+
with:
53+
# Read-only: small job; restore opportunistically from other jobs' caches but never write.
54+
cache-read-only: true
5255
- name: Build Iceberg Open API project
5356
run: ./gradlew :iceberg-open-api:shadowJar
5457
- name: Login to Docker Hub

.github/workflows/publish-snapshot.yml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,9 @@ jobs:
4444
distribution: zulu
4545
java-version: 17
4646
- uses: gradle/actions/setup-gradle@0723195856401067f7a2779048b490ace7a47d7c # v5.0.2
47+
with:
48+
# Read-only: small job; restore opportunistically from other jobs' caches but never write.
49+
cache-read-only: true
4750
- env:
4851
NEXUS_USER: ${{ secrets.NEXUS_USER }}
4952
NEXUS_PW: ${{ secrets.NEXUS_PW }}

0 commit comments

Comments
 (0)