You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/setup-gradle.md
+84-32Lines changed: 84 additions & 32 deletions
Original file line number
Diff line number
Diff line change
@@ -724,14 +724,90 @@ To reduce storage costs for these artifacts, you can set the `artifact-retention
724
724
artifact-retention-days: 1
725
725
```
726
726
727
-
# Develocity plugin injection
727
+
# Develocity Build Scan® integration
728
728
729
-
The `setup-gradle` action provides support for injecting and configuring the Develocity Gradle plugin into any Gradle build, without any modification to the project sources.
730
-
This is achieved via an init-script installed into Gradle User Home, which is enabled and parameterized via environment variables.
729
+
Publishing a Develocity Build Scan can be very helpful for Gradle builds run on GitHub Actions. Each Build Scan provides a
730
+
detailed report of the execution of the build, including which tasks were executed and the results of any test execution.
731
+
732
+
The `setup-gradle` plugin provides a number of features to enable and enhance publishing Build Scans® to a Develocity instance.
733
+
734
+
## Publishing to scans.gradle.com
735
+
736
+
If you don't have a a private Develocity instance, you can easily publish Build Scans to the
737
+
free, public Develocity instance (https://scans.gradle.com).
738
+
739
+
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Use](https://gradle.com/help/legal-terms-of-use).
# The build will automatically use a short-lived access token to authenticate with Develocity
789
+
- name: Run a Gradle build that is configured to publish to Develocity.
790
+
run: ./gradlew build
791
+
```
792
+
793
+
### Failure to obtain a short-lived access token
794
+
795
+
If a short-lived token cannot be retrieved (for example, if the Develocity server version is lower than `2024.1`):
796
+
- If the access key is provided via `develocity-access-key`, then no access token is set and authentication with Develocity will not succeed.
797
+
- If the access key is provided via an environment variable, a warning will be logged and the environment variable will be left as-is.
798
+
This can result in long-lived access keys being unintentionally exposed to other workflow steps.
799
+
For more information on short-lived tokens, see [Develocity API documentation](https://docs.gradle.com/develocity/api-manual/#short_lived_access_tokens).
800
+
801
+
## Develocity plugin injection
802
+
803
+
The `setup-gradle` action provides support for transparently injecting and configuring the Develocity Gradle plugin into any Gradle build,
804
+
without any modification to the project sources. This allows Build Scans to be published for a repository without any changes to the project sources.
805
+
806
+
Develocity injection is achieved via an init-script installed into Gradle User Home, which is enabled and parameterized via environment variables.
731
807
732
808
The same auto-injection behavior is available for the Common Custom User Data Gradle plugin, which enriches any build scans published with additional useful information.
733
809
734
-
## Enabling Develocity injection
810
+
### Enabling Develocity injection
735
811
736
812
To enable Develocity injection for your build, you must provide the required configuration via inputs.
737
813
@@ -770,14 +846,7 @@ In the likely scenario that your Develocity server requires authentication, you
770
846
771
847
This access key will be used during the action execution to get a short-lived token and set it to the DEVELOCITY_ACCESS_KEY environment variable.
772
848
773
-
### Short-lived access tokens
774
-
Develocity access keys are long-lived, creating risks if they are leaked. To avoid this, users can use short-lived access tokens to authenticate with Develocity. Access tokens can be used wherever an access key would be used. Access tokens are only valid for the Develocity instance that created them.
775
-
If a short-lived token fails to be retrieved (for example, if the Develocity server version is lower than `2024.1`):
776
-
- if a `GRADLE_ENTERPRISE_ACCESS_KEY` env var has been set, we're falling back to it with a deprecation warning
777
-
- otherwise no access key env var will be set. In that case Develocity authenticated operations like build cache read/write and build scan publication will fail without failing the build.
778
-
For more information on short-lived tokens, see [Develocity API documentation](https://docs.gradle.com/develocity/api-manual/#short_lived_access_tokens).
779
-
780
-
## Configuring Develocity injection
849
+
### Configuring Develocity injection
781
850
782
851
The `init-script` supports several additional configuration parameters that you may find useful. All configuration options (required and optional) are detailed below:
783
852
@@ -821,26 +890,9 @@ Here's an example using the env vars:
Develocity injection is designed to enable the publishing of build scans to a Develocity instance,
830
-
but is also useful for publishing to the public Build Scans instance (https://scans.gradle.com).
831
-
832
-
To publish to https://scans.gradle.com, you must specify in your workflow that you accept the [Gradle Terms of Use](https://gradle.com/help/legal-terms-of-use).
0 commit comments