Skip to content

Commit dbb6d8c

Browse files
traskjeanbisutti
andauthored
Update to new gradle action (#3972)
Co-authored-by: Jean Bisutti <[email protected]>
1 parent 85bd47b commit dbb6d8c

5 files changed

+52
-39
lines changed

.github/workflows/build-common.yml

+35-26
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ on:
66
no-build-cache:
77
type: boolean
88
required: false
9-
9+
1010
env:
1111
EXPORTER_VERSION: 1.0.0-beta.28 # to be updated with the latest version
1212

@@ -22,10 +22,11 @@ jobs:
2222
distribution: temurin
2323
java-version: 17
2424

25+
- name: Setup Gradle
26+
uses: gradle/actions/setup-gradle@v4
27+
2528
- name: Spotless
26-
uses: gradle/gradle-build-action@v3
27-
with:
28-
arguments: spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
29+
run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
2930

3031
gradle-wrapper-validation:
3132
runs-on: ubuntu-latest
@@ -52,12 +53,11 @@ jobs:
5253
mvn -version
5354
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.jar" -DpomFile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.pom" -DgroupId="com.azure" -DartifactId="azure-monitor-opentelemetry-exporter" -Dversion="${{ env.EXPORTER_VERSION }}"
5455
56+
- name: Setup Gradle
57+
uses: gradle/actions/setup-gradle@v4
58+
5559
- name: Generate license report
56-
uses: gradle/gradle-build-action@v3
57-
with:
58-
# ignore inputs.no-build-cache and always run with --no-build-cache
59-
# see https://github.com/jk1/Gradle-License-Report/issues/231
60-
arguments: generateLicenseReport --no-build-cache
60+
run: ./gradlew generateLicenseReport ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
6161

6262
- name: Check licenses
6363
run: |
@@ -98,11 +98,16 @@ jobs:
9898
mvn -version
9999
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.jar" -DpomFile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.pom" -DgroupId="com.azure" -DartifactId="azure-monitor-opentelemetry-exporter" -Dversion="${{ env.EXPORTER_VERSION }}"
100100
101+
- name: Setup Gradle
102+
uses: gradle/actions/setup-gradle@v4
103+
101104
- name: Assemble
102-
uses: gradle/gradle-build-action@v3
103-
with:
104-
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
105-
arguments: assemble -Dai.etw.native.build=release -x javadoc ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
105+
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
106+
run: >
107+
./gradlew assemble
108+
"-Dai.etw.native.build=release"
109+
-x javadoc
110+
${{ inputs.no-build-cache && '--no-build-cache' || '' }}
106111
107112
- name: Upload snapshot
108113
uses: actions/upload-artifact@v4
@@ -154,17 +159,20 @@ jobs:
154159
mvn -version
155160
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.jar" -DpomFile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.pom" -DgroupId="com.azure" -DartifactId="azure-monitor-opentelemetry-exporter" -Dversion="${{ env.EXPORTER_VERSION }}"
156161
162+
- name: Setup Gradle
163+
uses: gradle/actions/setup-gradle@v4
164+
157165
- name: Test
158-
uses: gradle/gradle-build-action@v3
159-
with:
160-
# spotless is checked separately since it's a common source of failure
161-
arguments: >
162-
check
163-
-x spotlessCheck
164-
-PtestJavaVersion=${{ matrix.test-java-version }}
165-
-PtestJavaVM=${{ matrix.vm }}
166-
-Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}
167-
-Porg.gradle.java.installations.auto-download=false ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
166+
# spotless is checked separately since it's a common source of failure
167+
run: >
168+
./gradlew
169+
check
170+
-x spotlessCheck
171+
-PtestJavaVersion=${{ matrix.test-java-version }}
172+
-PtestJavaVM=${{ matrix.vm }}
173+
"-Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}"
174+
"-Porg.gradle.java.installations.auto-download=false"
175+
${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
168176
169177
setup-smoke-test-matrix:
170178
runs-on: ubuntu-latest
@@ -201,7 +209,8 @@ jobs:
201209
mvn -version
202210
mvn install:install-file -Dfile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.jar" -DpomFile="azure-monitor-opentelemetry-exporter-${{ env.EXPORTER_VERSION }}.pom" -DgroupId="com.azure" -DartifactId="azure-monitor-opentelemetry-exporter" -Dversion="${{ env.EXPORTER_VERSION }}"
203211
212+
- name: Setup Gradle
213+
uses: gradle/actions/setup-gradle@v4
214+
204215
- name: Test
205-
uses: gradle/gradle-build-action@v3
206-
with:
207-
arguments: ${{ matrix.module }}:smokeTest
216+
run: ./gradlew ${{ matrix.module }}:smokeTest

.github/workflows/codeql-daily.yml

+6-4
Original file line numberDiff line numberDiff line change
@@ -26,10 +26,12 @@ jobs:
2626
with:
2727
languages: java
2828

29-
- uses: gradle/gradle-build-action@v3
30-
with:
31-
# skipping build cache is needed so that all modules will be analyzed
32-
arguments: assemble --no-build-cache
29+
- name: Setup Gradle
30+
uses: gradle/actions/setup-gradle@v4
31+
32+
- name: Assemble
33+
# skipping build cache is needed so that all modules will be analyzed
34+
run: ./gradlew assemble --no-build-cache
3335

3436
- name: Perform CodeQL analysis
3537
uses: github/codeql-action/analyze@v3

.github/workflows/owasp-dependency-check-daily.yml

+4-3
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,12 @@ jobs:
1919
distribution: temurin
2020
java-version: 17
2121

22-
- uses: gradle/gradle-build-action@v3
22+
- name: Setup Gradle
23+
uses: gradle/actions/setup-gradle@v4
24+
25+
- run: ./gradlew :agent:agent:dependencyCheckAnalyze
2326
env:
2427
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
25-
with:
26-
arguments: ":agent:agent:dependencyCheckAnalyze"
2728

2829
- name: Upload report
2930
if: always()

.github/workflows/perf-test_daily.yml

+5-4
Original file line numberDiff line numberDiff line change
@@ -18,14 +18,15 @@ jobs:
1818
distribution: temurin
1919
java-version: 17
2020

21+
- name: Setup Gradle
22+
uses: gradle/actions/setup-gradle@v4
23+
2124
- name: Build Application Insights Java agent
22-
uses: gradle/gradle-build-action@v3
23-
with:
24-
arguments: assemble
25+
run: ./gradlew assemble
2526

2627
- name: Run chmod to make gradlew executable
2728
run: chmod +x perf-tests/gradlew
28-
29+
2930
- name: Run perf test
3031
env:
3132
PERF_TEST_URL_PATTERN: ${{ secrets.PERF_TEST_URL_PATTERN }}

.github/workflows/pull-request-helper.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -20,8 +20,8 @@ jobs:
2020
run: |
2121
gh pr checkout $NUMBER
2222
23-
- name: Set up Gradle cache
24-
uses: gradle/gradle-build-action@v3
23+
- name: Setup Gradle
24+
uses: gradle/actions/setup-gradle@v4
2525
with:
2626
cache-read-only: true
2727

0 commit comments

Comments
 (0)