Skip to content

Update to new gradle action #3972

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 6 commits into from
Jan 9, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
61 changes: 35 additions & 26 deletions .github/workflows/build-common.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
no-build-cache:
type: boolean
required: false

env:
EXPORTER_VERSION: 1.0.0-beta.28 # to be updated with the latest version

Expand All @@ -22,10 +22,11 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Spotless
uses: gradle/gradle-build-action@v3
with:
arguments: spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }}

gradle-wrapper-validation:
runs-on: ubuntu-latest
Expand All @@ -52,12 +53,11 @@ jobs:
mvn -version
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 }}"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Generate license report
uses: gradle/gradle-build-action@v3
with:
# ignore inputs.no-build-cache and always run with --no-build-cache
# see https://github.com/jk1/Gradle-License-Report/issues/231
arguments: generateLicenseReport --no-build-cache
run: ./gradlew generateLicenseReport ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
Comment on lines -58 to +60
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

removed comment (and updated code) b/c that issue has been resolved now


- name: Check licenses
run: |
Expand Down Expand Up @@ -98,11 +98,16 @@ jobs:
mvn -version
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 }}"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Assemble
uses: gradle/gradle-build-action@v3
with:
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
arguments: assemble -Dai.etw.native.build=release -x javadoc ${{ inputs.no-build-cache && '--no-build-cache' || '' }}
# javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/
run: >
./gradlew assemble
"-Dai.etw.native.build=release"
-x javadoc
${{ inputs.no-build-cache && '--no-build-cache' || '' }}

- name: Upload snapshot
uses: actions/upload-artifact@v4
Expand Down Expand Up @@ -154,17 +159,20 @@ jobs:
mvn -version
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 }}"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Test
uses: gradle/gradle-build-action@v3
with:
# spotless is checked separately since it's a common source of failure
arguments: >
check
-x spotlessCheck
-PtestJavaVersion=${{ matrix.test-java-version }}
-PtestJavaVM=${{ matrix.vm }}
-Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}
-Porg.gradle.java.installations.auto-download=false ${{ inputs.no-build-cache && ' --no-build-cache' || '' }}
# spotless is checked separately since it's a common source of failure
run: >
./gradlew
check
-x spotlessCheck
-PtestJavaVersion=${{ matrix.test-java-version }}
-PtestJavaVM=${{ matrix.vm }}
"-Porg.gradle.java.installations.paths=${{ steps.setup-test-java.outputs.path }}"
"-Porg.gradle.java.installations.auto-download=false"
${{ inputs.no-build-cache && ' --no-build-cache' || '' }}

setup-smoke-test-matrix:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -201,7 +209,8 @@ jobs:
mvn -version
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 }}"

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Test
uses: gradle/gradle-build-action@v3
with:
arguments: ${{ matrix.module }}:smokeTest
run: ./gradlew ${{ matrix.module }}:smokeTest
10 changes: 6 additions & 4 deletions .github/workflows/codeql-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,10 +26,12 @@ jobs:
with:
languages: java

- uses: gradle/gradle-build-action@v3
with:
# skipping build cache is needed so that all modules will be analyzed
arguments: assemble --no-build-cache
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Assemble
# skipping build cache is needed so that all modules will be analyzed
run: ./gradlew assemble --no-build-cache

- name: Perform CodeQL analysis
uses: github/codeql-action/analyze@v3
Expand Down
7 changes: 4 additions & 3 deletions .github/workflows/owasp-dependency-check-daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,11 +19,12 @@ jobs:
distribution: temurin
java-version: 17

- uses: gradle/gradle-build-action@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- run: ./gradlew :agent:agent:dependencyCheckAnalyze
env:
NVD_API_KEY: ${{ secrets.NVD_API_KEY }}
with:
arguments: ":agent:agent:dependencyCheckAnalyze"

- name: Upload report
if: always()
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/perf-test_daily.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,14 +18,15 @@ jobs:
distribution: temurin
java-version: 17

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4

- name: Build Application Insights Java agent
uses: gradle/gradle-build-action@v3
with:
arguments: assemble
run: ./gradlew assemble

- name: Run chmod to make gradlew executable
run: chmod +x perf-tests/gradlew

- name: Run perf test
env:
PERF_TEST_URL_PATTERN: ${{ secrets.PERF_TEST_URL_PATTERN }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/pull-request-helper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,8 @@ jobs:
run: |
gh pr checkout $NUMBER

- name: Set up Gradle cache
uses: gradle/gradle-build-action@v3
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
cache-read-only: true

Expand Down
Loading