Commit graph

124 commits

Author SHA1 Message Date
daz
94355bbb2f
Split build-results and build-scan capture into separate files 2024-07-18 22:25:58 -06:00
daz
6d20c16462
Use settingsEvaluated in preference to projectsEvaluated in init-script 2024-07-18 22:25:53 -06:00
daz
72dde7ef1e
Move action entry-point sources 2024-07-18 11:09:54 -06:00
daz
27dea2df09
Allow better control over cache-cleanup
Adds new 'cache-cleanup' parameter with 3 settings: 'never', 'on-success' and 'always'.
This gives users more control over whether cache cleanup should occur.

Fixes #71
2024-07-17 20:36:33 -06:00
daz
91a526b647
Refactor BuildResults 2024-07-17 20:35:14 -06:00
daz
d92de28b80
Improve cache reporting
- More succinct messages for cache-read-only and cache-disabled
- Report on cache-cleanup enabled/disabled status
2024-07-17 20:29:57 -06:00
daz
8d318190ad
Add better explanation for cache status
- Clarify default settings for cache-read-only
- Explain why cache was disabled or read-only
- Provide links to documentation in Job Summary

Fixes #255
2024-07-17 15:17:09 -06:00
daz
bb7a843511
Reset dependency-graph after submission
Fixes #204
2024-07-16 21:15:51 -06:00
daz
22818445b3
Restrict download-and-submit to selected file 2024-07-16 21:15:29 -06:00
Daz DeBoer
dff3ef9b8d
Only fetch checksums for unknown wrapper versions (#292)
The checksum values for most wrapper versions are hard-coded into the
action. These known checksum values are first used for validation: only
if none of the known values work do we download checksums.

Previously, we blindly downloaded all of the checksum values in this
case: we now only download the checksums for versions that are not in
our "known" set.

Fixes #171
2024-07-16 13:04:57 -06:00
Daz DeBoer
ff865cb801
Upload dependency graph on submission failure (#291) 2024-07-15 12:47:06 -06:00
daz
c3acd19a4a Update to Gradle 8.9
Some checks failed
CI-check-and-unit-test / check-format-and-unit-test (push) Has been cancelled
CI-codeql / Analyze (javascript-typescript) (push) Has been cancelled
CI-init-script-check / test-init-scripts (push) Has been cancelled
CI-integ-test / determine-suite (push) Has been cancelled
CI-update-dist / update-dist (push) Has been cancelled
CI-integ-test / build-distribution (push) Has been cancelled
CI-integ-test / action-inputs (push) Has been cancelled
CI-integ-test / build-scan-publish (push) Has been cancelled
CI-integ-test / cache-cleanup (push) Has been cancelled
CI-integ-test / caching-config (push) Has been cancelled
CI-integ-test / dependency-graph (push) Has been cancelled
CI-integ-test / dependency-submission (push) Has been cancelled
CI-integ-test / dependency-submission-failures (push) Has been cancelled
CI-integ-test / execution-with-caching (push) Has been cancelled
CI-integ-test / execution (push) Has been cancelled
CI-integ-test / develocity-injection (push) Has been cancelled
CI-integ-test / provision-gradle-versions (push) Has been cancelled
CI-integ-test / restore-configuration-cache (push) Has been cancelled
CI-integ-test / restore-containerized-gradle-home (push) Has been cancelled
CI-integ-test / restore-custom-gradle-home (push) Has been cancelled
CI-integ-test / restore-gradle-home (push) Has been cancelled
CI-integ-test / restore-java-toolchain (push) Has been cancelled
CI-integ-test / sample-kotlin-dsl (push) Has been cancelled
CI-integ-test / sample-gradle-plugin (push) Has been cancelled
CI-integ-test / toolchain-detection (push) Has been cancelled
CI-integ-test / wrapper-validation (push) Has been cancelled
2024-07-14 08:12:33 -06:00
dependabot[bot]
d7cd9fc65c Bump com.fasterxml.jackson.dataformat:jackson-dataformat-smile
Bumps [com.fasterxml.jackson.dataformat:jackson-dataformat-smile](https://github.com/FasterXML/jackson-dataformats-binary) from 2.17.1 to 2.17.2.
- [Commits](https://github.com/FasterXML/jackson-dataformats-binary/compare/jackson-dataformats-binary-2.17.1...jackson-dataformats-binary-2.17.2)

---
updated-dependencies:
- dependency-name: com.fasterxml.jackson.dataformat:jackson-dataformat-smile
  dependency-type: direct:production
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-07-12 11:30:33 -06:00
github-actions[bot]
6407986e96
Update known wrapper checksums (#278)
Automatically generated pull request to update the known wrapper
checksums.

Co-authored-by: bigdaz <179734+bigdaz@users.noreply.github.com>
2024-07-12 11:29:43 -06:00
daz
621f3b3f79
Run cache-cleanup build with --info
Resolves #169
2024-06-28 13:25:56 -06:00
daz
95ef72241e
Use Gradle 8.8 features for cleanup
Gradle 8.8 introduces new features that allow us to avoid using
timestamp manipulation to force the cleanup of the Gradle User Home directory.

This solution is simpler and more robust, but relies on Gradle 8.8+ always being
used for the cache cleanup operation.

Fixes #24
2024-06-28 13:06:23 -06:00
daz
169bec5d8b
Provision latest Gradle for cache-cleanup
To cleanup Gradle User Home, a Gradle build must be executed.
Newer Gradle versions are able to cleanup the home directories of older versions,
but not vice-versa.

With this change, the latest version of Gradle is automatically provisioned
in order to run Gradle User Home cleanup. This ensures a consistent version of
Gradle is used for cleanup, and fixes #33 where Gradle is not pre-installed on
a custom runner.
2024-06-28 12:39:09 -06:00
Daz DeBoer
b9abb7b195
Use latest dependency graph plugin (#269)
Some checks are pending
CI-check-and-unit-test / check-format-and-unit-test (push) Waiting to run
CI-codeql / Analyze (javascript-typescript) (push) Waiting to run
CI-init-script-check / test-init-scripts (push) Waiting to run
CI-integ-test / wrapper-validation (push) Blocked by required conditions
CI-integ-test / determine-suite (push) Waiting to run
CI-integ-test / build-distribution (push) Blocked by required conditions
CI-integ-test / action-inputs (push) Blocked by required conditions
CI-integ-test / build-scan-publish (push) Blocked by required conditions
CI-integ-test / cache-cleanup (push) Blocked by required conditions
CI-integ-test / caching-config (push) Blocked by required conditions
CI-integ-test / dependency-graph (push) Blocked by required conditions
CI-integ-test / dependency-submission (push) Blocked by required conditions
CI-integ-test / dependency-submission-failures (push) Blocked by required conditions
CI-integ-test / execution-with-caching (push) Blocked by required conditions
CI-integ-test / execution (push) Blocked by required conditions
CI-integ-test / develocity-injection (push) Blocked by required conditions
CI-integ-test / provision-gradle-versions (push) Blocked by required conditions
CI-integ-test / restore-configuration-cache (push) Blocked by required conditions
CI-integ-test / restore-containerized-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-custom-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-gradle-home (push) Blocked by required conditions
CI-integ-test / restore-java-toolchain (push) Blocked by required conditions
CI-integ-test / sample-kotlin-dsl (push) Blocked by required conditions
CI-integ-test / sample-gradle-plugin (push) Blocked by required conditions
CI-integ-test / toolchain-detection (push) Blocked by required conditions
CI-update-dist / update-dist (push) Waiting to run
2024-06-27 19:42:01 -06:00
bigdaz
3f3913eed0 Update known wrapper checksums 2024-06-27 14:11:23 -06:00
Alexis Tual
bdc7162ff9
Forward the setup short-lived token Promise
This caused a race condition not allowing the short-lived token to be returned in time before the setup finished.
2024-06-17 19:03:10 +02:00
Daz DeBoer
719985db3d
Simplify requesting short-lived Develocity access tokens (#259)
- Always fetch a token for every hostname in the access key
- Use any tokens that are successfully fetched
- Retain access key if no tokens can be fetched
2024-06-14 21:18:08 -06:00
Inaki Villar
5f1c5827bf handle missing access token 2024-06-14 16:44:06 -06:00
daz
8dbe9a3802 Update DV access key regex to be more selective
This should address the code-scanning alert
  https://github.com/gradle/actions/security/code-scanning/1
2024-06-13 13:35:19 -06:00
daz
30c82f0068 Fail on invalid boolean for Develocity inputs 2024-06-13 13:31:25 -06:00
Iñaki Villar
d0a116fff5
Adding Develocity input actions (#244)
Adding Develocity input actions. 

If an input is configured in the action, it will generate the environment variable, example:

```yaml
    - name: Setup Gradle
      uses: gradle/actions/setup-gradle@v3
      with:
        develocity-injection-enabled: true
        develocity-url: https://develocity.your-server.com
        develocity-plugin-version: 3.17.4

    - name: Run a Gradle build with Develocity injection enabled from input actions
      run: ./gradlew build
```

This configuration will create the environment variables:
```
DEVELOCITY_INJECTION_ENABLED=true
DEVELOCITY_URL=https://develocity.your-server.com
DEVELOCITY_PLUGIN_VERSION=3.17.4
```

Relation variable-input available:

| Variable | Input |

|--------------------------------------|--------------------------------------|
| DEVELOCITY_INJECTION_ENABLED | develocity-injection-enabled |
| DEVELOCITY_URL | develocity-url |
| DEVELOCITY_ALLOW_UNTRUSTED_SERVER | develocity-allow-untrusted-server
|
| DEVELOCITY_CAPTURE_FILE_FINGERPRINTS |
develocity-capture-file-fingerprints |
| DEVELOCITY_ENFORCE_URL | develocity-enforce-url |
| DEVELOCITY_PLUGIN_VERSION | develocity-plugin-version |
| DEVELOCITY_CCUD_PLUGIN_VERSION | develocity-ccud-plugin-version |
| GRADLE_PLUGIN_REPOSITORY_URL | gradle-plugin-repository-url |
| GRADLE_PLUGIN_REPOSITORY_USERNAME | gradle-plugin-repository-username
|
| GRADLE_PLUGIN_REPOSITORY_PASSWORD | gradle-plugin-repository-password
|
2024-06-13 12:42:47 -06:00
bot-githubaction
1d2ea6e5a8 Bump references to Develocity Gradle plugin from 3.17.4 to 3.17.5 2024-06-13 10:01:04 -06:00
dependabot[bot]
114c1c234e Bump braces from 3.0.2 to 3.0.3 in /sources
Bumps [braces](https://github.com/micromatch/braces) from 3.0.2 to 3.0.3.
- [Changelog](https://github.com/micromatch/braces/blob/master/CHANGELOG.md)
- [Commits](https://github.com/micromatch/braces/compare/3.0.2...3.0.3)

---
updated-dependencies:
- dependency-name: braces
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-06-13 09:10:17 -06:00
daz
2db3ae936e Update to Gradle 8.8 2024-06-13 09:03:40 -06:00
bigdaz
d1cd62d80a Update known wrapper checksums 2024-06-13 07:40:03 -06:00
Bot Githubaction
30610bc983
Bump references to Develocity Gradle plugin from 3.17.3 to 3.17.4 (#236)
This PR bumps references to Develocity Gradle plugin from 3.17.3 to 3.17.4.

---------

Co-authored-by: Eric Haag <ehaag@gradle.com>
2024-05-23 08:56:09 -06:00
Alexis Tual
96b9cb4988
Set both DEVELOCITY_ACCESS_KEY and GRADLE_ENTERPRISE_ACCESS_KEY env vars (#225)
Follow up of https://github.com/gradle/actions/pull/224, we now attempt to set both old and new access key env variables to a short lived token.
If a short-lived token cannot be obtained, then:
- DEVELOCITY_ACCESS_KEY is set to an empty string, preventing this from being used.
- GRADLE_ENTERPRISE_ACCESS_KEY is left intact, with a deprecation warning being issued.
2024-05-17 15:07:50 -06:00
Bot Githubaction
db270b9337 Update develocity-injection init script to v1.0
Updates the develocity-injection init script to the latest reference script content
from https://github.com/gradle/develocity-ci-injection.
2024-05-17 14:18:19 -06:00
Bot Githubaction
d91e2960eb Update develocity-injection init script to v0.5.1
Updates the develocity-injection init script to the latest reference script content
from https://github.com/gradle/develocity-ci-injection.
2024-05-17 11:10:27 -06:00
bigdaz
0498421560 Update develocity-injection init script to v0.5.0 2024-05-17 07:27:33 -06:00
bigdaz
edb13383f3 Update develocity-injection init script to v0.4.0 2024-05-15 16:56:41 -06:00
Alexis Tual
500e0ee5b3
Add support for short-lived tokens (#224)
The setup-gradle action tries to get a short-lived access token given the supplied Develocity access key.
This key can be passed either with the `DEVELOCITY_ACCESS_KEY` env var or via the  `develocity-access-key` input parameter.
If a token can be retrieved, then the `DEVELOCITY_ACCESS_KEY` env var will be set to the token. 
Otherwise the `DEVELOCITY_ACCESS_KEY` will be set to a blank string, to avoid a leak.

---------

Co-authored-by: daz <daz@gradle.com>
2024-05-15 16:49:55 -06:00
Daz DeBoer
ea14aa9caf
Dependency updates (#222)
- Bump to com.gradle.develocity plugin v3.17.3
- Bump JVM dependencies in sample projects
2024-05-11 07:45:47 -06:00
bigdaz
da512b52a5 Update known wrapper checksums 2024-04-28 15:49:59 +01:00
Daz DeBoer
bce7daca54
Improve build scan badge readability with long tasks (#200)
Improve readability of build scan when requested tasks is very long, as
agreed in #175. HTML diff for each case of job summary is clearer in
cd62d9c9ef.

- Ensure a minimum size for the badge, at least the size of "Build
scan®", by preventing a line break with `&nbsp;`
- Reduce the size of the badge by tweaking the inner text

Also fix a typo in the build shell script.
2024-04-25 21:22:36 +01:00
Gabriel Feo
cd62d9c9ef Improve job summary readability with long tasks
Change tests for nbsp and concise badge

Make tests pass

Signed-off-by: Gabriel Feo <gabriel@gabrielfeo.com>
2024-04-25 19:40:04 +01:00
Gabriel Feo
a54fb6a5bb Add tests on current job-summary behavior
Signed-off-by: Gabriel Feo <gabriel@gabrielfeo.com>
2024-04-25 17:44:41 +01:00
daz
7763d71170 Set the report dir for download-and-submit
Fixes #196
2024-04-25 11:19:43 +01:00
daz
d124ec149f Retain and log stacktrace for submission errors 2024-04-19 10:24:45 -06:00
Alex Serbin
6ccde15122
Use logger in dependency graph init script (#191)
Dependency graph init script now uses Gradle logger to emit warning/info messages.
This allows these messages to be suppressed using `--quiet`.
2024-04-19 07:03:17 -06:00
Daz DeBoer
c198d84863
Support custom report dir for dependency-submission (#189)
If the `DEPENDENCY_GRAPH_REPORT_DIR` var is set, use this value when locating dependency-graph files to upload/submit.

Fixes #188
2024-04-18 13:40:41 -06:00
daz
eef9b10930 Bump Develocity and CCUD plugin versions 2024-04-17 19:08:51 -06:00
daz
6d55902761 Deprecate 'wrapper-validation-action'
Deprecation warning will be emitted when we:
- Change 'wrapper-validation-action' to delegate to 'actions/wrapper-validation'
- Add the 'wrapper-validation-action' id as env var before delegating
2024-04-12 10:34:50 -06:00
daz
feb10e7858
Minor formatting fix 2024-04-12 00:39:23 -06:00
daz
b855ea8d07
Revert inconsequential change 2024-04-11 22:55:22 -06:00
daz
3e6b0e422f
Inconsequential change 2024-04-11 22:47:10 -06:00