Repository navigation
96 lines (77 loc) · 2.08 KB
/
Copy pathrun-gradle-command.yml
File metadata and controls
96 lines (77 loc) · 2.08 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
name: Run Gradle Command
on:
workflow_dispatch:
inputs:
command:
description: "Gradle command arguments (without ./gradlew)"
required: true
type: string
default: "runTestsInCI --continue"
is_test:
description: "Set ANDROIDIDE_TEST=true"
required: false
type: boolean
default: false
stacktrace:
description: "Add --stacktrace"
required: false
type: boolean
default: false
info:
description: "Add --info"
required: false
type: boolean
default: false
debug:
description: "Add --debug"
required: false
type: boolean
default: false
permissions:
contents: read
jobs:
run:
name: Run Gradle Command
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
with:
persist-credentials: false
- name: Set up JDK 21
uses: actions/setup-java@v5
with:
distribution: temurin
java-version: "21"
- name: Setup Gradle
uses: gradle/actions/setup-gradle@v5
- name: Make Gradle wrapper executable
run: chmod +x gradlew
- name: Run command
env:
GRADLE_COMMAND: ${{ inputs.command }}
IS_TEST: ${{ inputs.is_test }}
STACKTRACE: ${{ inputs.stacktrace }}
INFO: ${{ inputs.info }}
DEBUG: ${{ inputs.debug }}
run: |
read -r -a args <<< "$GRADLE_COMMAND"
if [ "$STACKTRACE" = "true" ]; then
args+=(--stacktrace)
fi
if [ "$INFO" = "true" ]; then
args+=(--info)
fi
if [ "$DEBUG" = "true" ]; then
args+=(--debug)
fi
if [ "$IS_TEST" = "true" ]; then
export ANDROIDIDE_TEST=true
fi
printf 'Running: ./gradlew'
printf ' %q' "${args[@]}"
printf '\n'
if [ "$IS_TEST" = "true" ]; then
echo "ANDROIDIDE_TEST=true"
fi
./gradlew "${args[@]}"