aboutsummaryrefslogtreecommitdiff
path: root/.github/reusable-workflows/setup-gradle
diff options
context:
space:
mode:
authorHarsh Shandilya <me@msfjarvis.dev>2024-04-13 14:45:08 +0530
committerHarsh Shandilya <me@msfjarvis.dev>2024-04-13 14:50:29 +0530
commit312f92d21a5b8925496d5015357c257dace3a028 (patch)
treeef4119ef6308dc4732de6702cf0b90e8066c373a /.github/reusable-workflows/setup-gradle
parent13a2da9f33be815a1a982d1d8e75e882a6460bd0 (diff)
refactor(ci): introduce a composite workflow
Diffstat (limited to '.github/reusable-workflows/setup-gradle')
-rw-r--r--.github/reusable-workflows/setup-gradle/action.yml58
1 files changed, 58 insertions, 0 deletions
diff --git a/.github/reusable-workflows/setup-gradle/action.yml b/.github/reusable-workflows/setup-gradle/action.yml
new file mode 100644
index 00000000..bdbd90ce
--- /dev/null
+++ b/.github/reusable-workflows/setup-gradle/action.yml
@@ -0,0 +1,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@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
+ with:
+ fetch-depth: ${{ inputs.fetch-depth }}
+ ref: ${{ inputs.ref }}
+ token: ${{ inputs.token }}
+
+ - name: Set up JDK
+ uses: actions/setup-java@99b8673ff64fbf99d8d325f52d9a5bdedb8483e9 # v4.2.1
+ 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@6cec5d49d4d6d4bb982fbed7047db31ea6d38f11 # v3
+ 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