Skip to content

Commit

Permalink
Update gradle enterprise server (#4691)
Browse files Browse the repository at this point in the history
Co-authored-by: Nicola Corti <corti.nico@gmail.com>
  • Loading branch information
chao2zhang and cortinico committed Apr 8, 2022
1 parent 966cc50 commit 2f5e18e
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 4 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/detekt-with-type-resolution.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- '**'

env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

jobs:
plain:
runs-on: ubuntu-latest
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/pre-merge.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@ on:
branches:
- '**'

env:
GRADLE_ENTERPRISE_ACCESS_KEY: ${{ secrets.GRADLE_ENTERPRISE_ACCESS_KEY }}

jobs:
gradle:
if: ${{ !contains(github.event.head_commit.message, 'ci skip') }}
Expand Down
20 changes: 16 additions & 4 deletions settings.gradle.kts
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import com.gradle.enterprise.gradleplugin.internal.extension.BuildScanExtensionWithHiddenFeatures

rootProject.name = "detekt"

pluginManagement {
Expand Down Expand Up @@ -40,16 +42,26 @@ enableFeaturePreview("TYPESAFE_PROJECT_ACCESSORS")
// build scan plugin can only be applied in settings file
plugins {
`gradle-enterprise`
id("com.gradle.common-custom-user-data-gradle-plugin") version "1.6.5"
}

gradleEnterprise {
val isCiBuild = System.getenv("CI") != null

buildScan {
termsOfServiceUrl = "https://gradle.com/terms-of-service"
if (isCiBuild) {
termsOfServiceAgree = "yes"
publishAlways()
publishAlways()

// Publish to scans.gradle.com when `--scan` is used explicitly
if (!gradle.startParameter.isBuildScan) {
server = "https://ge.detekt.dev"
this as BuildScanExtensionWithHiddenFeatures
publishIfAuthenticated()
}

isUploadInBackground = !isCiBuild

capture {
isTaskInputFiles = true
}
}
}
Expand Down

0 comments on commit 2f5e18e

Please sign in to comment.