Repository navigation
485 lines (419 loc) · 14.1 KB
/
Copy pathci.yml
File metadata and controls
485 lines (419 loc) · 14.1 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
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
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
# This workflow will build the main SET application and publish it to GitHub Packages
name: Build SET
on:
repository_dispatch:
pull_request:
push:
tags:
- 'v**'
branches:
- 'release/**'
- 'main'
paths-ignore:
- DEPENDENCIES
# Enable concurrency to avoid multiple builds at the same time
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
env:
GITHUB_TOKEN: ${{secrets.GITHUB_TOKEN}}
DEPLOY_DIR: ${{ github.workspace }}/java/java-test/m2deploy
DIFF_DIR: java/java-test/diff
TEST_APPLICATION_DIR: ${{ github.workspace }}/java/java-test/application-under-test
MVN_FLAGS: -T 1.5C -B --settings ./.github/settings.xml --no-transfer-progress
jobs:
docs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Asciidoctor & Hugo
uses: eclipse-set/build/.github/actions/setup-asciidoctor@main
- name: Build About
run: hugo
working-directory: web/about
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: about-artifact
path: web/about/dist
retention-days: 1
developerhelp:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Install Asciidoctor & Hugo
uses: eclipse-set/build/.github/actions/setup-asciidoctor@main
- name: Build About
run: hugo
working-directory: web/developerhelp
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: developerhelp-artifact
path: web/developerhelp/dist
retention-days: 1
textviewer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: |
npm ci
npm run build-prod
working-directory: web/textviewer
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: textviewer-artifact
path: web/textviewer/dist
retention-days: 1
pdfviewer:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Build
run: |
wget --no-verbose -O pdfjs.zip https://github.com/mozilla/pdf.js/releases/download/v$(node getVersion.js)/pdfjs-$(node getVersion.js)-dist.zip
npm ci
npm run build-prod
working-directory: web/pdf
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: pdfviewer-artifact
path: web/pdf/dist
retention-days: 1
siteplan:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Cache node_modules
uses: actions/cache@v6
with:
enableCrossOsArchive: true
path: ${{ github.workspace }}/web/siteplan/node_modules/
key: ${{ runner.os }}-node_modules-${{ hashFiles('web/siteplan/package-lock.json') }}
restore-keys: ${{ runner.os }}-node_modules-
- name: Build
run: |
npm ci
npm run build-prod
working-directory: web/siteplan
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: siteplan-artifact
path: web/siteplan/dist
retention-days: 1
news:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v7
- name: Setup Java
uses: eclipse-set/build/.github/actions/setup-java@main
- name: Install Asciidoctor & Hugo
uses: eclipse-set/build/.github/actions/setup-asciidoctor@main
- name: Build Release Notes
run: mvn -Dnote-file-path="${{github.workspace}}/RELEASE_NOTES.md" clean compile
working-directory: web/news
- name: Store artifact
uses: actions/upload-artifact@v7
with:
name: news-artifact
path: web/news/public
retention-days: 1
java:
runs-on: ubuntu-latest
needs:
- docs
- textviewer
- pdfviewer
- siteplan
- developerhelp
- news
permissions:
contents: write
packages: write
checks: write
pull-requests: write
actions: read
steps:
- uses: actions/checkout@v7
- name: Setup Java
uses: eclipse-set/build/.github/actions/setup-java@main
- name: Fetch pdf viewer
uses: actions/download-artifact@v8
with:
name: pdfviewer-artifact
path: web/pdf/dist
- name: Fetch text viewer
uses: actions/download-artifact@v8
with:
name: textviewer-artifact
path: web/textviewer/dist
- name: Fetch about
uses: actions/download-artifact@v8
with:
name: about-artifact
path: web/about/dist
- name: Fetch siteplan
uses: actions/download-artifact@v8
with:
name: siteplan-artifact
path: web/siteplan/dist
- name: Fetch developerhelp
uses: actions/download-artifact@v8
with:
name: developerhelp-artifact
path: web/developerhelp/dist
- name: Fetch news
uses: actions/download-artifact@v8
with:
name: news-artifact
path: web/news/public
- name: Build
run: |
m2RepoPath="local::file://${{ env.DEPLOY_DIR }}"
if [[ ${{github.ref}} == "refs/heads/main" || "${{github.ref}}" == refs/tags/* ]]; then
m2RepoPath="set-github::https://maven.pkg.github.com/${{ github.repository }}"
fi
mvn -U ${{ env.MVN_FLAGS }} -f java/pom.xml deploy checkstyle:checkstyle -DaltDeploymentRepository="$m2RepoPath" -DskipTests
env:
GITHUB_TOKEN: ${{ github.token }}
- name: Upload artifact
uses: actions/upload-artifact@v7
with:
name: eclipse-set-snapshot-${{github.run_number}}
path: java/bundles/org.eclipse.set.releng.set.product/target/products/SET/win32/win32/x86_64/
retention-days: 7
- name: Upload m2repo artifact
uses: actions/upload-artifact@v7
if: github.event_name == 'pull_request' || startsWith(github.ref, 'refs/heads/release')
with:
name: set-m2deploy-${{github.run_number}}
path: ${{ env.DEPLOY_DIR }}
retention-days: 1
- name: Prepare release asset
if: startsWith(github.ref, 'refs/tags/')
run: |
VERSION=$(echo ${{ github.ref_name }} | cut -c 2-)
mv *.zip unsigned-Eclipse-SET-$VERSION.zip
working-directory: java/bundles/org.eclipse.set.releng.set.product/target/products
- name: Upload release asset
if: startsWith(github.ref, 'refs/tags/')
uses: softprops/action-gh-release@efb35369e0ad2afab669f228072c1b0d510eae64 # v3.0.3
with:
files: java/bundles/org.eclipse.set.releng.set.product/target/products/unsigned-Eclipse-SET-*.zip
tests:
runs-on: ubuntu-latest
needs:
- docs
- textviewer
- pdfviewer
- siteplan
- developerhelp
- news
permissions:
checks: write
pull-requests: write
steps:
- uses: actions/checkout@v7
- name: Setup Java
uses: eclipse-set/build/.github/actions/setup-java@main
- name: Fetch pdf viewer
uses: actions/download-artifact@v8
with:
name: pdfviewer-artifact
path: web/pdf/dist
- name: Fetch text viewer
uses: actions/download-artifact@v8
with:
name: textviewer-artifact
path: web/textviewer/dist
- name: Fetch about
uses: actions/download-artifact@v8
with:
name: about-artifact
path: web/about/dist
- name: Fetch siteplan
uses: actions/download-artifact@v8
with:
name: siteplan-artifact
path: web/siteplan/dist
- name: Fetch developerhelp
uses: actions/download-artifact@v8
with:
name: developerhelp-artifact
path: web/developerhelp/dist
- name: Fetch news
uses: actions/download-artifact@v8
with:
name: news-artifact
path: web/news/public
- name: Run Tests
run: |
mvn ${{ env.MVN_FLAGS }} -f java/pom.xml verify \
-Dtycho.source.skip=true \
-DskipP2Metadata=true \
-Dmaven.javadoc.skip=true
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@d0a4676d0e0b938bc201470d88276b7c74c712b3 # v2.24.0
if: always()
with:
files: |
${{ github.workspace }}/**/surefire-reports/*.xml
codeql:
runs-on: ubuntu-latest
needs:
- docs
- textviewer
- pdfviewer
- siteplan
- developerhelp
- news
permissions:
security-events: write
if: github.ref == 'refs/heads/main'
steps:
- uses: actions/checkout@v7
- name: Initialize CodeQL
uses: github/codeql-action/init@v4.38.2
with:
languages: java, javascript
config: |
paths-ignore:
- '**/dist/**'
- '**/target/**'
- '**/xtend-gen/**'
- '**/siteplan/assets/**'
- '**/monaco/vs/**'
- name: Setup Java
uses: eclipse-set/build/.github/actions/setup-java@main
- name: Fetch pdf viewer
uses: actions/download-artifact@v8
with:
name: pdfviewer-artifact
path: web/pdf/dist
- name: Fetch text viewer
uses: actions/download-artifact@v8
with:
name: textviewer-artifact
path: web/textviewer/dist
- name: Fetch about
uses: actions/download-artifact@v8
with:
name: about-artifact
path: web/about/dist
- name: Fetch siteplan
uses: actions/download-artifact@v8
with:
name: siteplan-artifact
path: web/siteplan/dist
- name: Fetch developerhelp
uses: actions/download-artifact@v8
with:
name: developerhelp-artifact
path: web/developerhelp/dist
- name: Fetch news
uses: actions/download-artifact@v8
with:
name: news-artifact
path: web/news/public
- name: Trace compilation
run: mvn ${{ env.MVN_FLAGS }} -f java/pom.xml compile
- name: Perform CodeQL Analysis
uses: github/codeql-action/analyze@v4.38.2
swtbot:
runs-on: windows-latest
needs:
- java
permissions:
contents: write
checks: write
pull-requests: write
actions: read
steps:
- uses: actions/checkout@v7
- name: Setup Java
uses: eclipse-set/build/.github/actions/setup-java@main
- name: Fetch SET
uses: actions/download-artifact@v8
with:
name: eclipse-set-snapshot-${{github.run_number}}
path: ${{ env.TEST_APPLICATION_DIR }}
- name: Fetch m2 Deploy
# For main or tag build, the m2 packages can be taken directly from github m2package
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/tags/')
uses: actions/download-artifact@v8
with:
name: set-m2deploy-${{github.run_number}}
path: ${{ env.DEPLOY_DIR }}
- name: Fetch main csv files
if: github.ref != 'refs/heads/main' && !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/tags/')
uses: eclipse-set/build/.github/actions/fetch-main-table-csv-ref@main
with:
repo: ${{ github.repository }}
continue-on-error: true
- name: Run Test
id: test-steps
shell: bash
run: |
m2RepoPath="https://maven.pkg.github.com/eclipse-set/set"
if [[ "${{ github.event_name }}" == "pull_request" || "${{github.ref}}" == refs/heads/release/* ]]; then
m2RepoPath="file://${{ env.DEPLOY_DIR }}"
fi
mvn ${{ env.MVN_FLAGS }} -f java/java-test/pom.xml verify \
-Dskip-test=false \
-Dm2-repo-path="$m2RepoPath" \
-Dapplication-under-test="${{ env.TEST_APPLICATION_DIR }}" \
-Dtycho.source.skip=true \
-DskipP2Metadata=true \
-Dmaven.javadoc.skip=true
- name: Upload csv files
if: failure() && steps.test-steps.outcome == 'failure'
uses: actions/upload-artifact@v7
with:
name: table-csv-${{github.run_number}}
path: ${{ github.workspace}}/java/bundles/org.eclipse.set.swtbot/target/classes/diff/**/*.csv
retention-days: 7
table-diff-view:
runs-on: ubuntu-latest
needs: swtbot
if: always() && (needs.swtbot.result == 'success' || needs.swtbot.result == 'failure') && github.actor_id != 49699333 && !startsWith(github.ref, 'refs/heads/release/') && !startsWith(github.ref, 'refs/tags/')
container: ghcr.io/eclipse-set/table-diff-view:latest
permissions:
contents: write
checks: write
pull-requests: write
actions: read
issues: write
steps:
- name: Get Branchname
shell: bash
run: |
if [ "${{ github.event_name }}" == "pull_request" ]; then
echo "BRANCH_NAME=${{ github.head_ref }}" >> $GITHUB_ENV
else
echo "BRANCH_NAME=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
fi
- name: Fetch table csv
if: needs.swtbot.result == 'failure'
uses: actions/download-artifact@v8
with:
name: table-csv-${{github.run_number}}
path: ${{ env.DIFF_DIR }}
- name: Create diff view
shell: bash
run: |
python -m tablediffview \
--diffDir=${{ env.DIFF_DIR }} \
--branchName=${{ env.BRANCH_NAME }} \
--prNumber=${{github.event.pull_request.number}} \
--runId=${{github.run_id}}
- name: Upload Diff-File
if: needs.swtbot.result == 'failure'
uses: actions/upload-artifact@v7
with:
name: table-diff-files-${{github.run_number}}
path: ${{ env.DIFF_DIR }}/diff-md
retention-days: 5