forked from apache/netbeans
-
Notifications
You must be signed in to change notification settings - Fork 1
378 lines (300 loc) · 10.9 KB
/
main.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
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
# Licensed to the Apache Software Foundation (ASF) under one
# or more contributor license agreements. See the NOTICE file
# distributed with this work for additional information
# regarding copyright ownership. The ASF licenses this file
# to you under the Apache License, Version 2.0 (the
# "License"); you may not use this file except in compliance
# with the License. You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing,
# software distributed under the License is distributed on an
# "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
# KIND, either express or implied. See the License for the
# specific language governing permissions and limitations
# under the License.
name: NetBeans
on:
push:
pull_request:
# cancel PR workflow run if PR is updated while jobs are still running
# if this is not a PR run (no github.head_ref defined), it won't be affected
concurrency:
group: ${{ github.head_ref || github.run_id }}
cancel-in-progress: true
jobs:
# primary build job, most other jobs use the artifact produced here
# artifact is only produced once in the matrix
base-build:
name: Build Clusters on JDK ${{ matrix.java }}
runs-on: ubuntu-latest
env:
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
strategy:
matrix:
java: [ '11', '17' ]
fail-fast: false
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Caching dependencies
uses: actions/cache@v2
with:
path: ~/.hgexternalcache
key: ${{ runner.os }}-${{ hashFiles('*/external/binaries-list', '*/*/external/binaries-list') }}
restore-keys: ${{ runner.os }}-
- name: Checkout ${{ github.ref }} ( ${{ github.sha }} )
uses: actions/checkout@v3
- name: Build NetBeans
run: ant -Dcluster.config=release build-nozip
- name: Prepare Artifact
if: ${{ matrix.java == '11' }}
run: tar -I 'zstd -9 -T0' -cf /tmp/build.tar.zst --exclude ".git" .
- name: Upload Build
if: ${{ (matrix.java == '11') && success() }}
uses: actions/upload-artifact@v3
with:
name: build
path: /tmp/build.tar.zst
retention-days: 1
if-no-files-found: error
# secondary jobs
linux-commit-validation:
needs: base-build
name: Commit Validation on Linux/JDK ${{ matrix.java }}
runs-on: ubuntu-latest
env:
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
strategy:
matrix:
java: [ '8', '11', '17', '19-ea' ]
fail-fast: false
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
- name: Extract
run: tar --zstd -xf build.tar.zst
- name: Commit Validation tests
run: ant -Dcluster.config=release commit-validation
- name: Upload Build
if: failure()
uses: actions/upload-artifact@v3
with:
name: validation-log-linux-${{ matrix.java }}
path: /home/runner/work/netbeans/netbeans/nbbuild/build/test/commit-validation/results/
retention-days: 1
linux-build-system-test:
needs: base-build
name: Build-System Test on Linux/JDK ${{ matrix.java }}
runs-on: ubuntu-latest
env:
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
strategy:
matrix:
java: [ '11' ]
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
- name: Extract
run: tar --zstd -xf build.tar.zst
- name: Test Netbeans Build System
run: ant -Dcluster.config=release localtest
linux-javadoc:
needs: base-build
name: Build NBMs, Source zips and Javadoc on JDK ${{ matrix.java }}
runs-on: ubuntu-latest
strategy:
matrix:
java: [ '11' ]
env:
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
- name: Extract
run: tar --zstd -xf build.tar.zst
- name: Build nbms
run: ant build-nbms
- name: Build source zips
run: ant build-source-zips
- name: Build javadoc
run: ant build-javadoc
macos:
needs: base-build
name: Tests on MacOS/JDK ${{ matrix.java }}
runs-on: macos-11
env:
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
strategy:
matrix:
java: [ '11' ]
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
- uses: actions/cache@v2
with:
path: ~/Library/Caches/Homebrew
key: ${{ runner.os }}-homebrew
restore-keys: ${{ runner.os }}-homebrew
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
# tar on MacOS is not aware of zstd "tar --zstd -xf build.tar.zst" isn't working
- name: Extract
run: unzstd -c build.tar.zst | tar -x
- run: brew install ant
- name: Test platform/masterfs.macosx
run: ant -f platform/masterfs.macosx test
- name: Test platform/core.network
run: ant -f platform/core.network test
- name: Commit Validation tests
run: ant -Dcluster.config=release commit-validation
php:
needs: base-build
name: PHP on ${{ matrix.os }}/JDK ${{ matrix.java }}
runs-on: ${{ matrix.os }}
defaults:
run:
shell: bash
env:
DISPLAY: ":99.0"
ANT_OPTS: -Dmetabuild.jsonurl=https://raw.githubusercontent.com/apache/netbeans-jenkins-lib/master/meta/netbeansrelease.json
OPTS: -Dtest-unit-sys-prop.ignore.random.failures=true
strategy:
matrix:
java: [ '8' ]
os: [ 'windows-2022', 'ubuntu-20.04' ]
fail-fast: false
steps:
- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v2
with:
java-version: ${{ matrix.java }}
distribution: 'zulu'
# linux specific setup
- name: Setup PHP
if: contains(matrix.os, 'ubuntu')
uses: shivammathur/[email protected]
with:
php-version: '7.4'
tools: pecl
extensions: xdebug
ini-values: xdebug.mode=debug
- name: Launch Xvfb
if: contains(matrix.os, 'ubuntu')
run: Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
# - - -
- name: Download Build
uses: actions/download-artifact@v3
with:
name: build
- name: Extract
run: tar --zstd -xf build.tar.zst
- name: Test Platform Core Network
run: ant $OPTS -f platform/core.network test
- name: Test PHP Hudson
run: ant $OPTS -f php/hudson.php test
- name: Test PHP Neon
run: ant $OPTS -f php/languages.neon test
- name: Test PHP API Annotation
run: ant $OPTS -f php/php.api.annotation test
- name: Test PHP API Documentation
run: ant $OPTS -f php/php.api.documentation test
- name: Test PHP API Executable
run: ant $OPTS -f php/php.api.executable test
- name: Test PHP API Framework
run: ant $OPTS -f php/php.api.framework test
- name: Test PHP API Module
run: ant $OPTS -f php/php.api.phpmodule test
- name: Test PHP API Testing
run: ant $OPTS -f php/php.api.testing test
- name: Test PHP ApiGen
run: ant $OPTS -f php/php.apigen test
- name: Test PHP Atoum
run: ant $OPTS -f php/php.atoum test
- name: Test PHP Code Analysis
run: ant $OPTS -f php/php.code.analysis test
- name: Test PHP Codeception
run: ant $OPTS -f php/php.codeception test
- name: Test PHP Composer
run: ant $OPTS -f php/php.composer test
# needs X fails on fails on Windows
- name: Test PHP Debugger
if: contains(matrix.os, 'ubuntu')
run: ant $OPTS -f php/php.dbgp test
- name: Test PHP Doctrine2
run: ant $OPTS -f php/php.doctrine2 test
- name: Test PHP Editor
run: ant $OPTS -f php/php.editor test
- name: Test PHP Latte
run: ant $OPTS -f php/php.latte test
- name: Test PHP Nette Tester
run: ant $OPTS -f php/php.nette.tester test
- name: Test PHPUnit
run: ant $OPTS -f php/php.phpunit test
- name: Test PHP Project
run: ant $OPTS -f php/php.project test
- name: Test PHP Refactoring
run: ant $OPTS -f php/php.refactoring test
- name: Test PHP Smarty
run: ant $OPTS -f php/php.smarty test
- name: Test PHP Symfony
run: ant $OPTS -f php/php.symfony test
- name: Test PHP Symfony 2
run: ant $OPTS -f php/php.symfony2 test
- name: Test PHP Twig
run: ant $OPTS -f php/php.twig test
- name: Test PHP Zend
run: ant $OPTS -f php/php.zend test
- name: Test PHP Zend 2
run: ant $OPTS -f php/php.zend2 test
- name: Test PHP Spellchecker Bindings
run: ant $OPTS -f php/spellchecker.bindings.php test
# last job depends on everything so that it is forced to run last even if a long job fails early
cleanup:
name: Cleanup Workflow Artifacts
needs: [base-build, linux-commit-validation, linux-build-system-test, linux-javadoc, macos, php]
# don't cleanup on failure() or always(), because someone might want to restart an unreliable secondary job
# if primary jobs fail there won't be anything to cleanup anyway.
if: success() || cancelled()
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
with:
persist-credentials: false
submodules: recursive
- uses: ./.github/actions/delete-artifact/
name: Delete build Artifact
with:
name: build
failOnError: true