Skip to content

Commit

Permalink
Switch to Develocity plugin
Browse files Browse the repository at this point in the history
  • Loading branch information
bigdaz committed Oct 30, 2024
1 parent b48ed39 commit 13977cd
Show file tree
Hide file tree
Showing 4 changed files with 44 additions and 46 deletions.
76 changes: 38 additions & 38 deletions .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,8 +9,6 @@ on:
jobs:
quick-check:
runs-on: ubuntu-latest
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4

Expand All @@ -22,6 +20,8 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Execute Gradle Build
run: ./gradlew build
Expand All @@ -35,8 +35,6 @@ jobs:
# Latest 8.x is tested in 'quick-check' job using the wrapper
gradle-version: [ "5.2.1", "5.6.4", "6.0.1", "6.9.4", "7.1.1", "7.6.4", "8.0.2", "8.8"]
runs-on: ubuntu-latest
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4

Expand All @@ -48,6 +46,8 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Execute Gradle Build
run: ./gradlew -S build -DtestGradleVersion=${{ matrix.gradle-version }}
Expand All @@ -59,8 +59,6 @@ jobs:
matrix:
jvm-version: [ "8", "11", "17", "21", "22"]
runs-on: ubuntu-latest
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4

Expand All @@ -72,40 +70,42 @@ jobs:

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Execute Gradle Build
run: ./gradlew -S build -DtestGradleVersion=8.8

self-test:
needs: quick-check
runs-on: ubuntu-latest
env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin

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

- name: Self Test :plugin
run: ./plugin-self-test ForceDependencyResolutionPlugin_resolveAllDependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_DEPENDENCY_GRAPH_JOB_ID: ${{ github.run_id }}
GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR: "plugin-self-test"
GITHUB_DEPENDENCY_GRAPH_REF: ${{ github.ref }}
GITHUB_DEPENDENCY_GRAPH_SHA: ${{ github.sha }}
GITHUB_DEPENDENCY_GRAPH_WORKSPACE: ${{ github.workspace }}

- name: Save plugin JSON report
uses: actions/upload-artifact@v4
with:
name: plugin-json
path: build/reports/dependency-graph-snapshots/plugin-self-test.json
if-no-files-found: error
needs: quick-check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up JDK
uses: actions/setup-java@v4
with:
java-version: 11
distribution: temurin

- name: Setup Gradle
uses: gradle/actions/setup-gradle@v4
with:
develocity-access-key: ${{ secrets.DEVELOCITY_ACCESS_KEY }}

- name: Self Test :plugin
run: ./plugin-self-test ForceDependencyResolutionPlugin_resolveAllDependencies
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_DEPENDENCY_GRAPH_JOB_ID: ${{ github.run_id }}
GITHUB_DEPENDENCY_GRAPH_JOB_CORRELATOR: "plugin-self-test"
GITHUB_DEPENDENCY_GRAPH_REF: ${{ github.ref }}
GITHUB_DEPENDENCY_GRAPH_SHA: ${{ github.sha }}
GITHUB_DEPENDENCY_GRAPH_WORKSPACE: ${{ github.workspace }}

- name: Save plugin JSON report
uses: actions/upload-artifact@v4
with:
name: plugin-json
path: build/reports/dependency-graph-snapshots/plugin-self-test.json
if-no-files-found: error
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ class SampleProjectDependencyExtractorTest extends BaseExtractorTest {
def manifestDependencies = manifest.resolved

[ // plugin dependencies
"com.gradle:gradle-enterprise-gradle-plugin:3.12.6",
"com.gradle:develocity-gradle-plugin:3.18.1",
"com.diffplug.spotless:spotless-plugin-gradle:4.5.1",
"com.diffplug.durian:durian-core:1.2.0",
].forEach {
Expand Down
2 changes: 1 addition & 1 deletion sample-projects/java-single-project/settings.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
plugins {
id 'com.gradle.enterprise' version '3.12.6'
id 'com.gradle.develocity' version '3.18.1'
}
rootProject.name = 'java-lib'
10 changes: 4 additions & 6 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,16 +1,14 @@
plugins {
id("com.gradle.enterprise").version("3.13")
id("com.gradle.common-custom-user-data-gradle-plugin").version("1.10")
id("com.gradle.develocity").version("3.18.1")
id("com.gradle.common-custom-user-data-gradle-plugin").version("2.0.2")
}

val isCI = !System.getenv("CI").isNullOrEmpty()

gradleEnterprise {
develocity {
server = "https://ge.gradle.org"
buildScan {
publishAlways()
capture { isTaskInputFiles = true }
isUploadInBackground = !isCI
uploadInBackground = !isCI

obfuscation {
ipAddresses { addresses -> addresses.map { _ -> "0.0.0.0" } }
Expand Down

0 comments on commit 13977cd

Please sign in to comment.