| # Licensed to the Apache Software Foundation (ASF) under one |
| # or more contributor license agreements. See the NOTICE file |
| # distributed with this work for additional information |
| # regarding copyright ownership. The ASF licenses this file |
| # to you under the Apache License, Version 2.0 (the |
| # "License"); you may not use this file except in compliance |
| # with the License. You may obtain a copy of the License at |
| # |
| # http://www.apache.org/licenses/LICENSE-2.0 |
| # |
| # Unless required by applicable law or agreed to in writing, |
| # software distributed under the License is distributed on an |
| # "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY |
| # KIND, either express or implied. See the License for the |
| # specific language governing permissions and limitations |
| # under the License. |
| # |
| --- |
| name: "Gradle Setup" |
| description: "Setup Java and Gradle" |
| inputs: |
| # Composite actions do not support typed parameters. Everything is treated as a string |
| # See: https://github.com/actions/runner/issues/2238 |
| java-version: |
| description: "Java version to use" |
| default: "17" |
| gradle-cache-read-only: |
| description: "Should the Gradle cache be read-only?" |
| default: "true" |
| gradle-cache-write-only: |
| description: "Should the Gradle cache be write-only?" |
| default: "false" |
| develocity-access-key: |
| description: "Optional access key for uploading build scans to Develocity" |
| default: "" |
| runs: |
| using: "composite" |
| steps: |
| - name: Setup Java |
| uses: actions/setup-java@v5 |
| with: |
| distribution: temurin |
| java-version: ${{ inputs.java-version }} |
| - name: Setup Gradle |
| uses: gradle/actions/setup-gradle@94baf225fe0a508e581a564467443d0e2379123b # v4.3.0 |
| env: |
| GRADLE_BUILD_ACTION_CACHE_DEBUG_ENABLED: true |
| with: |
| gradle-version: wrapper |
| develocity-access-key: ${{ inputs.develocity-access-key }} |
| develocity-token-expiry: 4 |
| cache-read-only: ${{ inputs.gradle-cache-read-only }} |
| cache-write-only: ${{ inputs.gradle-cache-write-only }} |
| # Cache downloaded JDKs in addition to the default directories. |
| gradle-home-cache-includes: | |
| caches |
| notifications |
| jdks |
| cache-cleanup: on-success |