aboutsummaryrefslogtreecommitdiff
path: root/.github/reusable-workflows/setup-gradle/action.yml
blob: fbb563de4e74de44e32262209f18616593ad41e4 (about) (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
name: 'Setup Gradle'
description: 'Checks out the repository and sets up Java and Gradle'
inputs:
  token:
    description: 'token input for actions/checkout'
    required: false
    default: ${{ github.token }}
  fetch-depth:
    description: 'fetch-depth input for actions/checkout'
    required: false
    default: 1
  ref:
    description: 'ref input for actions/checkout'
    required: false
  java-version:
    description: 'java-version input for actions/setup-java'
    required: false
    default: 20
  gradle-version:
    description: 'gradle-version input for actions/setup-java'
    required: false
  cache-read-only:
    description: 'cache-read-only input for gradle/actions/setup-gradle'
    required: false
    default: ${{ github.event.repository != null && github.ref_name != github.event.repository.default_branch }}
  dependency-graph:
    description: 'dependency-graph input for gradle/actions/setup-gradle'
    required: false
    default: 'disabled'
runs:
  using: "composite"
  steps:
    - name: Checkout repository
      uses: actions/checkout@692973e3d937129bcbf40652eb9f2f61becf3332 # v4.1.7
      with:
        fetch-depth: ${{ inputs.fetch-depth }}
        ref: ${{ inputs.ref }}
        token: ${{ inputs.token }}

    - name: Set up JDK
      uses: actions/setup-java@6a0805fcefea3d4657a47ac4c165951e33482018 # v4.2.2
      with:
        distribution: temurin
        java-version: ${{ inputs.java-version }}

    - name: Copy CI gradle.properties
      shell: bash
      run: mkdir -p ~/.gradle ; cp .github/ci-gradle.properties ~/.gradle/gradle.properties

    - name: Setup Gradle
      uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4
      with:
        add-job-summary: always
        cache-read-only: ${{ inputs.cache-read-only }}
        dependency-graph: ${{ inputs.dependency-graph }}
        gradle-home-cache-cleanup: true
        gradle-version: ${{ inputs.gradle-version }}
        validate-wrappers: true