-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathaction.yml
161 lines (140 loc) · 4.97 KB
/
action.yml
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
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
name: "Gradle run"
description: "Runs gradle tasks with preset and customizable arguments and flags"
inputs:
gradle_task:
description: "The gradle task you wish to run"
type: string
required: true
gradle_workDir:
description: "Working directory, in which the gradle command will be executed"
type: string
required: false
default: ''
gradle_flags:
description: "Additional gradle flags to add"
required: false
default: ''
parallel:
description: "Set parallel build [true]"
type: boolean
required: false
default: true
build_cache:
description: "Set build cache enabled [false]"
type: string
required: false
default: 'false'
clean_build:
description: "WIP - Execute clean prior to running main task [false]"
type: boolean
required: false
default: false
sdk_download:
description: "Download sdk image -Pandroid.builder.sdkDownload [false]"
type: boolean
required: false
default: false
jvm_args:
description: "Jvm Args [-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx1g]"
type: string
required: false
default: '-Xmx3g -XX:+HeapDumpOnOutOfMemoryError -Dfile.encoding=UTF-8 -Dkotlin.daemon.jvm.options=-Xmx1g'
java_home:
description: "Java home args [$JAVA_HOME_11_X64]"
type: string
required: false
default: $JAVA_HOME_11_X64
success_artefact_location:
description: "Location of the artefact to upload if previous step succeeded, upload will not commence if no value is provided [Optional]"
type: string
required: false
default: ''
success_artefact_name:
description: "Name of the uploaded artefact if previous step succeeded, upload will not commence if no value is provided [Optional]"
type: string
required: false
default: ''
failure_artefact_location:
description: "Location of the artefact to upload if previous step failed, upload will not commence if no value is provided [Optional]"
type: string
required: false
default: ''
failure_artefact_name:
description: "Name of the uploaded artefact if previous step failed, upload will not commence if no value is provided [Optional]"
type: string
required: false
default: ''
maven_username:
description: "Username to access the internal maven repository"
required: true
maven_password:
description: "Password to access the internal maven repository"
required: true
condition:
description: "Condition to print it out if not empty"
required: false
default: ''
runs:
using: "composite"
steps:
- run: echo "runner ${{ inputs.runner }}"
shell: bash
- run: echo "gradle_task ${{ inputs.gradle_task }}"
shell: bash
- run: echo "parallel ${{ inputs.parallel }}"
shell: bash
- run: echo "build_cache ${{ inputs.build_cache }}"
shell: bash
- run: echo "clean_build ${{ inputs.clean_build }}"
shell: bash
- run: echo "sdk_download ${{ inputs.sdk_download }}"
shell: bash
- run: echo "jvm_args ${{ inputs.jvm_args }}"
shell: bash
- run: echo "java_home ${{ inputs.java_home }}"
shell: bash
- run: echo "success_artefact_location ${{ inputs.success_artefact_location }}"
shell: bash
- run: echo "success_artefact_name ${{ inputs.success_artefact_name }}"
shell: bash
- run: echo "failure_artefact_location ${{ inputs.failure_artefact_location }}"
shell: bash
- run: echo "failure_artefact_name ${{ inputs.failure_artefact_name }}"
shell: bash
- run: echo "timeout-minutes ${{ inputs.timeout-minutes }}"
shell: bash
- run: echo "runner.os ${{ runner.os }}"
shell: bash
- name: Conditional echo
if: inputs.condition != ''
run: echo "Condition=${{ inputs.condition }}"
shell: bash
- name: Conditional joke
if: inputs.condition == ''
uses: h2floh/action-get-joke-of-the-day@v1
- name: FailCheck
if: failure() && inputs.condition != ''
uses: h2floh/action-get-joke-of-the-day@v1
- name: DoubleCheck
if: inputs.condition != '' && inputs.condition != ''
run: echo "Double Condition=${{ inputs.condition }}"
shell: bash
- name: Check build build_cache
if: inputs.build_cache == 'true'
run: echo "build_cache ${{ inputs.build_cache }}"
shell: bash
- name: Checkout branch
uses: actions/checkout@v2
- name: Run Gradle task
working-directory: ./${{ inputs.gradle_workDir }}
shell: bash
run: >-
./gradlew ${{ inputs.gradle_task }}
-Dorg.gradle.parallel=${{ inputs.parallel }}
-Dorg.gradle.caching=${{ inputs.build_cache }}
-Dorg.gradle.java.home=${{ inputs.java_home }}
-Dorg.gradle.jvmargs="${{ inputs.jvm_args }}"
-Pandroid.builder.sdkDownload=${{ inputs.sdk_download }}
-PMavenUsername=${{ inputs.maven_username }}
-PMavenPassword=${{ inputs.maven_password }}
${{ inputs.gradle_flags }}