diff --git a/.github/workflows/auto-update-otel-sdk.yml b/.github/workflows/auto-update-otel-sdk.yml index c2e80f5315..d740460ced 100644 --- a/.github/workflows/auto-update-otel-sdk.yml +++ b/.github/workflows/auto-update-otel-sdk.yml @@ -71,10 +71,11 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Update license report + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: generateLicenseReport + + - name: Update license report + run: ./gradlew generateLicenseReport - name: Undo license report clean if: failure() diff --git a/.github/workflows/build-common.yml b/.github/workflows/build-common.yml index d198840edf..2f05c63612 100644 --- a/.github/workflows/build-common.yml +++ b/.github/workflows/build-common.yml @@ -37,16 +37,18 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Spotless + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - arguments: spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }} cache-read-only: ${{ inputs.cache-read-only }} # gradle enterprise is used for the build cache gradle-home-cache-excludes: caches/build-cache-1 + - name: Spotless + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + run: ./gradlew spotlessCheck ${{ inputs.no-build-cache && '--no-build-cache' || '' }} + gradle-wrapper-validation: runs-on: ubuntu-latest steps: @@ -68,18 +70,20 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Generate license report + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - # currently ignoring inputs.no-build-cache and always running with --no-build-cache - # see https://github.com/jk1/Gradle-License-Report/issues/231 - arguments: generateLicenseReport --no-build-cache cache-read-only: ${{ inputs.cache-read-only }} # gradle enterprise is used for the build cache gradle-home-cache-excludes: caches/build-cache-1 + - name: Generate license report + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + # currently ignoring inputs.no-build-cache and always running with --no-build-cache + # see https://github.com/jk1/Gradle-License-Report/issues/231 + run: ./gradlew generateLicenseReport --no-build-cache + - name: Check licenses run: | # add any untracked folders that may have been added by generateLicenseReport @@ -140,17 +144,19 @@ jobs: run: | sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties - - name: Build + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - env: - GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} with: - # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ - arguments: check -x javadoc -x spotlessCheck -PskipTests=true ${{ inputs.no-build-cache && '--no-build-cache' || '' }} cache-read-only: ${{ inputs.cache-read-only }} # gradle enterprise is used for the build cache gradle-home-cache-excludes: caches/build-cache-1 + - name: Build + env: + GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} + # javadoc task fails sporadically fetching https://docs.oracle.com/javase/8/docs/api/ + run: ./gradlew check -x javadoc -x spotlessCheck -PskipTests=true ${{ inputs.no-build-cache && '--no-build-cache' || '' }} + - name: Check for jApiCmp diffs run: | # need to "git add" in case any generated files did not already exist @@ -232,19 +238,25 @@ jobs: - name: Start deadlock detector run: .github/scripts/deadlock-detector.sh + - name: Setup Gradle + uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 + with: + # only push cache for one matrix option since github action cache space is limited + cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }} + # gradle enterprise is used for the build cache + gradle-home-cache-excludes: caches/build-cache-1 + - name: List tests env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - # "check" is needed to activate all tests for listing purposes - # listTestsInPartition writes test tasks that apply to the given partition to a file named - # "test-tasks.txt" and then disables all tasks (including tests) after it runs - arguments: > - check -x spotlessCheck - listTestsInPartition - -PtestPartition=${{ matrix.test-partition }} - cache-read-only: true + # "check" is needed to activate all tests for listing purposes + # listTestsInPartition writes test tasks that apply to the given partition to a file named + # "test-tasks.txt" and then disables all tasks (including tests) after it runs + run: > + ./gradlew + check -x spotlessCheck + listTestsInPartition + -PtestPartition=${{ matrix.test-partition }} - name: Set test tasks run: | @@ -253,20 +265,15 @@ jobs: - name: Test env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - # spotless is checked separately since it's a common source of failure - arguments: > - ${{ env.test-tasks }} - -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' || '' }} - # only push cache for one matrix option since github action cache space is limited - cache-read-only: ${{ inputs.cache-read-only || matrix.test-java-version != 11 || matrix.vm != 'hotspot' }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 + # spotless is checked separately since it's a common source of failure + run: > + ./gradlew + ${{ env.test-tasks }} + -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' || '' }} - name: Build scan if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} @@ -383,13 +390,15 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Build + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 with: - arguments: build ${{ inputs.no-build-cache && '--no-build-cache' || '' }} - build-root-directory: gradle-plugins cache-read-only: ${{ inputs.cache-read-only }} + - name: Build + run: ./gradlew build ${{ inputs.no-build-cache && '--no-build-cache' || '' }} + working-directory: gradle-plugins + examples: runs-on: ubuntu-latest steps: diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 5302a81e7d..0f4612163f 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -72,6 +72,12 @@ jobs: distribution: temurin java-version: 17.0.6 + - name: Setup Gradle + uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 + with: + # gradle enterprise is used for the build cache + gradle-home-cache-excludes: caches/build-cache-1 + - name: Build and publish artifact snapshots env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} @@ -79,11 +85,7 @@ jobs: SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: assemble publishToSonatype - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 + run: ./gradlew assemble publishToSonatype - name: Build and publish gradle plugin snapshots env: @@ -92,9 +94,5 @@ jobs: SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - build-root-directory: gradle-plugins - arguments: build publishToSonatype - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 + run: ./gradlew build publishToSonatype + working-directory: gradle-plugins diff --git a/.github/workflows/codeql-daily.yml b/.github/workflows/codeql-daily.yml index 7a639d1242..00d7be9397 100644 --- a/.github/workflows/codeql-daily.yml +++ b/.github/workflows/codeql-daily.yml @@ -37,10 +37,12 @@ jobs: # see https://github.com/github/codeql-action/issues/1555#issuecomment-1452228433 tools: latest - - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - # skipping build cache is needed so that all modules will be analyzed - arguments: assemble -x javadoc --no-build-cache --no-daemon + - name: Setup Gradle + uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 + + - name: Build + # skipping build cache is needed so that all modules will be analyzed + run: ./gradlew assemble -x javadoc --no-build-cache --no-daemon - name: Perform CodeQL analysis uses: github/codeql-action/analyze@c7f9125735019aa87cfc361530512d50ea439c71 # v3.25.1 diff --git a/.github/workflows/overhead-benchmark-daily.yml b/.github/workflows/overhead-benchmark-daily.yml index ca9da6956a..f1d1b2df47 100644 --- a/.github/workflows/overhead-benchmark-daily.yml +++ b/.github/workflows/overhead-benchmark-daily.yml @@ -23,11 +23,12 @@ jobs: run: | rsync -avv gh-pages/benchmark-overhead/results/ benchmark-overhead/results/ - - name: Run tests + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: test - build-root-directory: benchmark-overhead + + - name: Run tests + working-directory: benchmark-overhead + run: ./gradlew test - name: Inspect the results dir working-directory: benchmark-overhead diff --git a/.github/workflows/owasp-dependency-check-daily.yml b/.github/workflows/owasp-dependency-check-daily.yml index 55a15c109d..7d7d275c82 100644 --- a/.github/workflows/owasp-dependency-check-daily.yml +++ b/.github/workflows/owasp-dependency-check-daily.yml @@ -29,8 +29,8 @@ jobs: sed -i "s/org.gradle.jvmargs=/org.gradle.jvmargs=-Xmx3g /" gradle.properties - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: ":javaagent:dependencyCheckAnalyze" + + - run: ./gradlew :javaagent:dependencyCheckAnalyze env: NVD_API_KEY: ${{ secrets.NVD_API_KEY }} diff --git a/.github/workflows/pr-smoke-test-fake-backend-images.yml b/.github/workflows/pr-smoke-test-fake-backend-images.yml index 69d5b71094..112c0f1094 100644 --- a/.github/workflows/pr-smoke-test-fake-backend-images.yml +++ b/.github/workflows/pr-smoke-test-fake-backend-images.yml @@ -24,14 +24,16 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Build Docker image + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 with: - arguments: ":smoke-tests:images:fake-backend:jibDockerBuild -Djib.httpTimeout=120000 -Djib.console=plain" cache-read-only: true # gradle enterprise is used for the build cache gradle-home-cache-excludes: caches/build-cache-1 + - name: Build Docker image + run: ./gradlew :smoke-tests:images:fake-backend:jibDockerBuild -Djib.httpTimeout=120000 -Djib.console=plain + buildWindows: runs-on: windows-latest defaults: @@ -49,8 +51,10 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Build Docker image + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 with: - arguments: ":smoke-tests:images:fake-backend:windowsBackendImageBuild" cache-read-only: true + + - name: Build Docker image + run: ./gradlew :smoke-tests:images:fake-backend:windowsBackendImageBuild diff --git a/.github/workflows/publish-smoke-test-fake-backend-images.yml b/.github/workflows/publish-smoke-test-fake-backend-images.yml index 45cc989ccd..7bbe2b5fe9 100644 --- a/.github/workflows/publish-smoke-test-fake-backend-images.yml +++ b/.github/workflows/publish-smoke-test-fake-backend-images.yml @@ -34,10 +34,11 @@ jobs: - name: Set tag run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV - - name: Build Docker image + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: ":smoke-tests:images:fake-backend:jib -Djib.httpTimeout=120000 -Djib.console=plain -PextraTag=${{ env.TAG }}" + + - name: Build Docker image + run: ./gradlew :smoke-tests:images:fake-backend:jib -Djib.httpTimeout=120000 -Djib.console=plain -PextraTag=${{ env.TAG }} publishWindows: runs-on: windows-latest @@ -66,10 +67,11 @@ jobs: - name: Set tag run: echo "TAG=$(date '+%Y%m%d').$GITHUB_RUN_ID" >> $GITHUB_ENV - - name: Build Docker image + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: ":smoke-tests:images:fake-backend:dockerPush -PextraTag=${{ env.TAG }}" + + - name: Build Docker image + run: ./gradlew :smoke-tests:images:fake-backend:dockerPush -PextraTag=${{ env.TAG }} workflow-notification: needs: diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 695bee3e51..674d02d859 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -85,18 +85,18 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Build and publish artifacts + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: assemble publishToSonatype closeAndReleaseSonatypeStagingRepository + + - name: Build and publish artifacts env: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} + run: ./gradlew assemble publishToSonatype closeAndReleaseSonatypeStagingRepository - name: Build and publish gradle plugins - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 env: SONATYPE_USER: ${{ secrets.SONATYPE_USER }} SONATYPE_KEY: ${{ secrets.SONATYPE_KEY }} @@ -104,10 +104,9 @@ jobs: GRADLE_PUBLISH_SECRET: ${{ secrets.GRADLE_PUBLISH_SECRET }} GPG_PRIVATE_KEY: ${{ secrets.GPG_PRIVATE_KEY }} GPG_PASSWORD: ${{ secrets.GPG_PASSWORD }} - with: - # Don't use publishToSonatype since we don't want to publish the marker artifact - arguments: build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository - build-root-directory: gradle-plugins + # Don't use publishToSonatype since we don't want to publish the marker artifact + run: ./gradlew build publishPlugins publishPluginMavenPublicationToSonatypeRepository closeAndReleaseSonatypeStagingRepository + working-directory: gradle-plugins - name: Generate release notes env: diff --git a/.github/workflows/reusable-muzzle.yml b/.github/workflows/reusable-muzzle.yml index 46a3ee955b..77bd5e86e7 100644 --- a/.github/workflows/reusable-muzzle.yml +++ b/.github/workflows/reusable-muzzle.yml @@ -33,8 +33,10 @@ jobs: distribution: temurin java-version: 17.0.6 - - name: Run muzzle + - name: Setup Gradle uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 with: - arguments: ${{ matrix.task }} cache-read-only: ${{ inputs.cache-read-only }} + + - name: Run muzzle + run: ./gradlew ${{ matrix.task }} diff --git a/.github/workflows/reusable-test-indy.yml b/.github/workflows/reusable-test-indy.yml index 489c73a380..596456acb0 100644 --- a/.github/workflows/reusable-test-indy.yml +++ b/.github/workflows/reusable-test-indy.yml @@ -58,33 +58,34 @@ jobs: path: ~/.pnpm-store key: ${{ runner.os }}-test-latest-cache-pnpm-modules + - name: Setup Gradle + uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 + with: + cache-read-only: ${{ inputs.cache-read-only }} + # gradle enterprise is used for the build cache + gradle-home-cache-excludes: caches/build-cache-1 + - name: List tests env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: > - check -x spotlessCheck - listTestsInPartition - -PtestPartition=${{ matrix.test-partition }} - cache-read-only: true + run: > + ./gradlew + check -x spotlessCheck + listTestsInPartition + -PtestPartition=${{ matrix.test-partition }} - name: Set test tasks run: | echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV - name: Test - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - with: - arguments: > - ${{ env.test-tasks }} - -PtestIndy=true - ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} - cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 + run: > + ./gradlew + ${{ env.test-tasks }} + -PtestIndy=true + ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} - name: Build scan if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }} diff --git a/.github/workflows/reusable-test-latest-deps.yml b/.github/workflows/reusable-test-latest-deps.yml index f4d30993af..6804154ad3 100644 --- a/.github/workflows/reusable-test-latest-deps.yml +++ b/.github/workflows/reusable-test-latest-deps.yml @@ -54,34 +54,35 @@ jobs: - name: Start deadlock detector run: .github/scripts/deadlock-detector.sh + - name: Setup Gradle + uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 + with: + cache-read-only: ${{ inputs.cache-read-only }} + # gradle enterprise is used for the build cache + gradle-home-cache-excludes: caches/build-cache-1 + - name: List tests env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 - with: - arguments: > - check -x spotlessCheck - listTestsInPartition - -PtestPartition=${{ matrix.test-partition }} - -PtestLatestDeps=true - cache-read-only: true + run: > + ./gradlew + check -x spotlessCheck + listTestsInPartition + -PtestPartition=${{ matrix.test-partition }} + -PtestLatestDeps=true - name: Set test tasks run: | echo "test-tasks=$(cat test-tasks.txt | xargs echo | sed 's/\n/ /g')" >> $GITHUB_ENV - name: Test - uses: gradle/actions/setup-gradle@750cdda3edd6d51b7fdfc069d2e2818cf3c44f4c # v3.3.1 env: GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }} - with: - arguments: > - ${{ env.test-tasks }} - -PtestLatestDeps=true - ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} - cache-read-only: ${{ inputs.cache-read-only }} - # gradle enterprise is used for the build cache - gradle-home-cache-excludes: caches/build-cache-1 + run: > + ./gradlew + ${{ env.test-tasks }} + -PtestLatestDeps=true + ${{ inputs.no-build-cache && ' --no-build-cache' || '' }} - name: Build scan if: ${{ !cancelled() && hashFiles('build-scan.txt') != '' }}