Skip to content

Commit efc7894

Browse files
authored
[v1.10.x branch] Cherry pick github action workflow updates into v1.10.x branch (#5249)
* More gradle build action cleanup (#5140) * Remove unnecessary gradle wrapper caching * Convert more to gradle-build-action * Remove fetch-depth (#5145) * Simplify release workflow (#5144) * Bump release date
1 parent 4264519 commit efc7894

24 files changed

+65
-416
lines changed

.github/workflows/ci.yml

Lines changed: 4 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
runs-on: ubuntu-latest
1313
steps:
1414
- uses: actions/[email protected]
15-
with:
16-
fetch-depth: 0
1715

1816
- name: Set up JDK 11 for running Gradle
1917
uses: actions/setup-java@v2
@@ -34,8 +32,6 @@ jobs:
3432
runs-on: ubuntu-latest
3533
steps:
3634
- uses: actions/[email protected]
37-
with:
38-
fetch-depth: 0
3935

4036
- name: Set up JDK 11 for running Gradle
4137
uses: actions/setup-java@v2
@@ -44,8 +40,10 @@ jobs:
4440
java-version: 11
4541

4642
- name: Build
47-
run: ../gradlew build
48-
working-directory: gradle-plugins
43+
uses: gradle/gradle-build-action@v2
44+
with:
45+
arguments: build
46+
build-root-directory: gradle-plugins
4947

5048
test:
5149
runs-on: ubuntu-latest
@@ -61,8 +59,6 @@ jobs:
6159
fail-fast: false
6260
steps:
6361
- uses: actions/[email protected]
64-
with:
65-
fetch-depth: 0
6662

6763
- id: setup-test-java
6864
name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
@@ -94,8 +90,6 @@ jobs:
9490
if: ${{ !startsWith(github.ref_name, 'v') }}
9591
steps:
9692
- uses: actions/[email protected]
97-
with:
98-
fetch-depth: 0
9993

10094
- name: Set up JDK 11 for running Gradle
10195
uses: actions/setup-java@v2
@@ -138,8 +132,6 @@ jobs:
138132
if: matrix.os == 'windows-latest'
139133

140134
- uses: actions/[email protected]
141-
with:
142-
fetch-depth: 0
143135

144136
- name: Set up JDK 11 for running Gradle
145137
uses: actions/setup-java@v2
@@ -167,8 +159,6 @@ jobs:
167159
steps:
168160
- name: Check out repository
169161
uses: actions/[email protected]
170-
with:
171-
fetch-depth: 0
172162

173163
- name: Set up JDK 11 for running Gradle
174164
uses: actions/setup-java@v2
@@ -194,8 +184,6 @@ jobs:
194184
steps:
195185
- name: Check out repository
196186
uses: actions/[email protected]
197-
with:
198-
fetch-depth: 0
199187

200188
- name: Set up JDK 11 for running Gradle
201189
uses: actions/setup-java@v2
@@ -222,8 +210,6 @@ jobs:
222210
runs-on: ubuntu-latest
223211
steps:
224212
- uses: actions/[email protected]
225-
with:
226-
fetch-depth: 0
227213

228214
- name: Set up JDK 11 for running Gradle
229215
uses: actions/setup-java@v2
@@ -274,8 +260,6 @@ jobs:
274260
if: github.repository == 'open-telemetry/opentelemetry-java-instrumentation'
275261
steps:
276262
- uses: actions/[email protected]
277-
with:
278-
fetch-depth: 0
279263

280264
- name: Set up JDK 11 for running Gradle
281265
uses: actions/setup-java@v2

.github/workflows/gradle-wrapper-validation.yml

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,5 @@ jobs:
1313
runs-on: ubuntu-latest
1414
steps:
1515
- uses: actions/[email protected]
16-
with:
17-
fetch-depth: 0
1816

1917
- uses: gradle/[email protected]

.github/workflows/nightly-benchmark-overhead.yml

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,10 @@ jobs:
2020
run: |
2121
rsync -avv gh-pages/benchmark-overhead/results/ benchmark-overhead/results/
2222
- name: run tests
23-
working-directory: benchmark-overhead
24-
run: ./gradlew test
23+
uses: gradle/gradle-build-action@v2
24+
with:
25+
arguments: test
26+
build-root-directory: benchmark-overhead
2527
- name: inspect the results dir
2628
working-directory: benchmark-overhead
2729
run: ls -lR results
@@ -46,8 +48,6 @@ jobs:
4648
- uses: technote-space/[email protected]
4749

4850
- uses: actions/[email protected]
49-
with:
50-
fetch-depth: 0
5151

5252
- uses: JasonEtco/[email protected]
5353
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure

.github/workflows/nightly-codeql-analysis.yml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -12,8 +12,6 @@ jobs:
1212
steps:
1313
- name: Checkout repository
1414
uses: actions/[email protected]
15-
with:
16-
fetch-depth: 0
1715

1816
- name: Initialize CodeQL
1917
uses: github/codeql-action/init@v1
@@ -43,8 +41,6 @@ jobs:
4341
- uses: technote-space/[email protected]
4442

4543
- uses: actions/[email protected]
46-
with:
47-
fetch-depth: 0
4844

4945
- uses: JasonEtco/[email protected]
5046
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure

.github/workflows/nightly-no-cache.yml

Lines changed: 25 additions & 63 deletions
Original file line numberDiff line numberDiff line change
@@ -11,21 +11,13 @@ jobs:
1111
runs-on: ubuntu-latest
1212
steps:
1313
- uses: actions/[email protected]
14-
with:
15-
fetch-depth: 0
1614

1715
- name: Set up JDK 11 for running Gradle
1816
uses: actions/setup-java@v2
1917
with:
2018
distribution: adopt
2119
java-version: 11
2220

23-
- name: Cache Gradle Wrapper
24-
uses: actions/cache@v2
25-
with:
26-
path: ~/.gradle/wrapper
27-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
28-
2921
- name: Build
3022
env:
3123
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -37,24 +29,18 @@ jobs:
3729
runs-on: ubuntu-latest
3830
steps:
3931
- uses: actions/[email protected]
40-
with:
41-
fetch-depth: 0
4232

4333
- name: Set up JDK 11 for running Gradle
4434
uses: actions/setup-java@v2
4535
with:
4636
distribution: adopt
4737
java-version: 11
4838

49-
- name: Cache Gradle Wrapper
50-
uses: actions/cache@v2
51-
with:
52-
path: ~/.gradle/wrapper
53-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
54-
5539
- name: Build
56-
run: ../gradlew build --no-build-cache
57-
working-directory: gradle-plugins
40+
uses: gradle/gradle-build-action@v2
41+
with:
42+
arguments: build --no-build-cache
43+
build-root-directory: gradle-plugins
5844

5945
test:
6046
runs-on: ubuntu-latest
@@ -70,8 +56,6 @@ jobs:
7056
fail-fast: false
7157
steps:
7258
- uses: actions/[email protected]
73-
with:
74-
fetch-depth: 0
7559

7660
- id: setup-test-java
7761
name: Set up JDK ${{ matrix.test-java-version }}-${{ matrix.vm }} for running tests
@@ -86,12 +70,6 @@ jobs:
8670
distribution: adopt
8771
java-version: 11
8872

89-
- name: Cache Gradle Wrapper
90-
uses: actions/cache@v2
91-
with:
92-
path: ~/.gradle/wrapper
93-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
94-
9573
- name: Test
9674
env:
9775
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -103,21 +81,13 @@ jobs:
10381
runs-on: ubuntu-latest
10482
steps:
10583
- uses: actions/[email protected]
106-
with:
107-
fetch-depth: 0
10884

10985
- name: Set up JDK 11 for running Gradle
11086
uses: actions/setup-java@v2
11187
with:
11288
distribution: adopt
11389
java-version: 11
11490

115-
- name: Cache Gradle Wrapper
116-
uses: actions/cache@v2
117-
with:
118-
path: ~/.gradle/wrapper
119-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
120-
12191
- name: Test
12292
env:
12393
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -151,21 +121,13 @@ jobs:
151121
if: matrix.os == 'windows-latest'
152122

153123
- uses: actions/[email protected]
154-
with:
155-
fetch-depth: 0
156124

157125
- name: Set up JDK 11 for running Gradle
158126
uses: actions/setup-java@v2
159127
with:
160128
distribution: adopt
161129
java-version: 11
162130

163-
- name: Cache Gradle Wrapper
164-
uses: actions/cache@v2
165-
with:
166-
path: ~/.gradle/wrapper
167-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('gradle/wrapper/gradle-wrapper.properties') }}
168-
169131
- name: Test
170132
env:
171133
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
@@ -180,41 +142,43 @@ jobs:
180142
runs-on: ubuntu-latest
181143
steps:
182144
- uses: actions/[email protected]
183-
with:
184-
fetch-depth: 0
185145

186146
- name: Set up JDK 11 for running Gradle
187147
uses: actions/setup-java@v2
188148
with:
189149
distribution: adopt
190150
java-version: 11
191151

192-
- name: Cache Gradle Wrapper
193-
uses: actions/cache@v2
194-
with:
195-
path: ~/.gradle/wrapper
196-
key: ${{ runner.os }}-gradle-wrapper-cache-${{ hashFiles('examples/distro/gradle/wrapper/gradle-wrapper.properties') }}
197-
198152
- name: Local publish of artifacts
199-
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
200-
run: ./gradlew publishToMavenLocal -x javadoc
153+
uses: gradle/gradle-build-action@v2
154+
with:
155+
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
156+
arguments: publishToMavenLocal -x javadoc
201157

202158
- name: Local publish of gradle plugins
203-
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
204-
run: ../gradlew publishToMavenLocal -x javadoc
205-
working-directory: gradle-plugins
159+
uses: gradle/gradle-build-action@v2
160+
with:
161+
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
162+
arguments: publishToMavenLocal -x javadoc
163+
build-root-directory: gradle-plugins
206164

207165
- name: Build distro
208-
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
209-
working-directory: examples/distro
166+
uses: gradle/gradle-build-action@v2
167+
with:
168+
arguments: build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
169+
build-root-directory: examples/distro
210170

211171
- name: Build extension
212-
run: ./gradlew build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
213-
working-directory: examples/extension
172+
uses: gradle/gradle-build-action@v2
173+
with:
174+
arguments: build --init-script ../../.github/scripts/local.init.gradle.kts --no-build-cache
175+
build-root-directory: examples/extension
214176

215177
- name: Run muzzle check against extension
216-
run: ./gradlew muzzle --init-script ../../.github/scripts/local.init.gradle.kts
217-
working-directory: examples/extension
178+
uses: gradle/gradle-build-action@v2
179+
with:
180+
arguments: muzzle --init-script ../../.github/scripts/local.init.gradle.kts
181+
build-root-directory: examples/extension
218182

219183
issue:
220184
name: Open issue on failure
@@ -227,8 +191,6 @@ jobs:
227191
- uses: technote-space/[email protected]
228192

229193
- uses: actions/[email protected]
230-
with:
231-
fetch-depth: 0
232194

233195
- uses: JasonEtco/[email protected]
234196
if: env.WORKFLOW_CONCLUSION == 'failure' # notify only if failure

0 commit comments

Comments
 (0)