-
-
Notifications
You must be signed in to change notification settings - Fork 107
201 lines (199 loc) · 7.66 KB
/
check-build.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
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
# https://docs.github.com/en/actions/learn-github-actions/workflow-syntax-for-github-actions
# Yes, booleans used here are 'strings' despite the type of input being declared as boolean because… well, see here:
# https://docs.github.com/en/actions/learn-github-actions/expressions
# https://github.com/marketplace/actions/gradle-build-action
name: Check build and tests of plugins and samples
on:
workflow_dispatch:
inputs:
check-for-memory-leaks:
description: "Check for memory leaks"
required: true
type: boolean
default: true
run-refreshVersions-task:
description: "Run the refreshVersions task"
required: true
type: boolean
default: false
sample-kotlin:
description: "Enable sample-kotlin"
required: true
type: boolean
default: true
sample-groovy:
description: "Enable sample-groovy"
required: true
type: boolean
default: true
sample-multi-modules:
description: "Enable sample-multi-modules"
required: true
type: boolean
default: true
sample-kotlin-js:
description: "Enable sample-kotlin-js"
required: true
type: boolean
default: true
sample-android:
description: "Enable sample-android"
required: true
type: boolean
default: false
run-on:
type: choice
description: "Where to run this workflow"
default: 'ubuntu-latest'
required: true
options:
- windows-2022
- windows-2019
- windows-latest
- macos-12
- macos-11
- macos-10.5
- macos-latest
- ubuntu-22.04
- ubuntu-20.04
- ubuntu-18.04
- ubuntu-latest
pull_request:
paths:
- 'plugins/**'
- 'sample-kotlin/**'
- 'sample-groovy/**'
- '!**.md'
- '!.editorconfig'
- '!**/.gitignore'
- '!**.adoc'
- '!docs/**'
push:
branches:
- main
paths:
- 'plugins/**'
- 'sample-kotlin/**'
- 'sample-groovy/**'
- '!**.md'
- '!.editorconfig'
- '!**/.gitignore'
- '!**.adoc'
- '!docs/**'
jobs:
check-all:
env:
GPG_key_id: ${{ secrets.GPG_KEY_ID }}
GPG_private_key: ${{ secrets.GPG_PRIVATE_KEY }}
GPG_private_password: ${{ secrets.GPG_PRIVATE_PASSWORD }}
runs-on: ${{ github.event.inputs.run-on || 'ubuntu-latest' }}
steps:
- name: "Enable long paths for git Windows"
if: ${{ runner.os == 'Windows' }}
run: git config --global core.longpaths true
- uses: actions/checkout@v2
- name: "Configure JDK"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: "Check plugins and publish them to MavenLocal"
uses: gradle/gradle-build-action@v2
with:
gradle-executable: plugins/gradlew
build-root-directory: plugins
arguments: check publishToMavenLocal --stacktrace --daemon
- name: "Configure JDK for old Gradle"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '11'
- name: "Run refreshVersions on sample-kotlin"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.sample-kotlin == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin/gradlew
build-root-directory: sample-kotlin
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-kotlin"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.sample-kotlin == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin/gradlew
build-root-directory: sample-kotlin
arguments: check --stacktrace --configuration-cache --daemon
- name: "Configure JDK back for new Gradle"
uses: actions/setup-java@v3
with:
distribution: 'temurin'
java-version: '17'
- name: "Check for memory leaks"
if: ${{ github.event_name != 'workflow_dispatch' || github.event.inputs.check-for-memory-leaks == 'true' }}
working-directory: sample-groovy
run: ./counted-stress-test.sh 10 ./gradlew --daemon -Dorg.gradle.jvmargs="-Xmx150M"
- name: "Run refreshVersions on sample-groovy"
if: ${{ github.event.inputs.sample-groovy == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
build-root-directory: sample-groovy
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-groovy"
if: ${{ github.event.inputs.sample-groovy == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
build-root-directory: sample-groovy
arguments: check --stacktrace --daemon
- name: "Check buildSrc of sample-groovy (simulates IDE Gradle sync)"
if: ${{ github.event.inputs.sample-groovy == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-groovy/gradlew
build-root-directory: sample-groovy/buildSrc
arguments: help --stacktrace --daemon
- name: "Run refreshVersions on sample-multi-modules"
if: ${{ github.event.inputs.sample-multi-modules == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-multi-modules/gradlew
build-root-directory: sample-multi-modules
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-multi-modules"
if: ${{ github.event.inputs.sample-multi-modules == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-multi-modules/gradlew
build-root-directory: sample-multi-modules
arguments: check --stacktrace --daemon
- name: "Run refreshVersions on sample-kotlin-js"
if: ${{ github.event.inputs.sample-kotlin-js == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin-js/gradlew
build-root-directory: sample-kotlin-js
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-kotlin-js"
if: ${{ github.event.inputs.sample-kotlin-js == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-kotlin-js/gradlew
build-root-directory: sample-kotlin-js
arguments: check --stacktrace --daemon
- name: "Run refreshVersions on sample-android"
if: ${{ github.event.inputs.sample-android == 'true' && github.event.inputs.run-refreshVersions-task == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-android/gradlew
build-root-directory: sample-android
arguments: refreshVersions --stacktrace --daemon
- name: "Check sample-android"
if: ${{ github.event.inputs.sample-android == 'true' }}
uses: gradle/gradle-build-action@v2
with:
gradle-executable: sample-android/gradlew
build-root-directory: sample-android
arguments: check --stacktrace --daemon
- name: "Stop Gradle daemon"
working-directory: plugins
run: ./gradlew --stop