-
Notifications
You must be signed in to change notification settings - Fork 0
460 lines (405 loc) · 11.9 KB
/
workflow.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
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
name: Python 3.12, Ruby 2.7, Node.js 16, Java 17, .NET 8, Go 1.21, Swift, Dart, allure
# on: [push]
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
# strategy:
# matrix:
# # ruby-version: ['2.6', '2.7', '3.0']
# ruby-version: ['2.7']
# # node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
# node-version: [16.x]
steps:
- uses: actions/checkout@v3
python:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Set up Python 3.12
uses: actions/setup-python@v4
with:
python-version: 3.12
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
# - name: Lint with flake8
# run: |
# flake8 .
- name: Lint with black
run: |
black .
- name: Test with pytest
if: always()
run: |
pwd
pytest --alluredir=allure-results
# - name: Analysing the code with pylint
# run: |
# pylint `ls -R|grep .py$|xargs`
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
ruby:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
# ruby-version: ['2.6', '2.7', '3.0']
ruby-version: ['2.7']
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Experimental installation
if: always()
run: |
rm Gemfile.lock
# bundle install
- name: Set up Ruby
# To automatically get bug fixes and new Ruby versions for ruby/setup-ruby,
# change this to (see https://github.com/ruby/setup-ruby#versioning):
# uses: ruby/setup-ruby@v1
uses: ruby/setup-ruby@473e4d8fe5dd94ee328fdfca9f8c9c7afc9dae5e
if: always()
with:
ruby-version: ${{ matrix.ruby-version }}
bundler-cache: true # runs 'bundle install' and caches installed gems automatically
# - name: Experimental installation
# if: always()
# run: |
# rm Gemfile.lock
# bundle install
- name: Run tests
if: always()
run: bundle exec rake
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
node:
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
# node-version: [10.x, 12.x, 14.x, 15.x, 16.x]
node-version: [16.x]
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
if: always()
with:
node-version: ${{ matrix.node-version }}
- run: npm ci
- run: npm run build --if-present
- run: npm test
# - run: find -name '*.test.js' | while read test ; do echo $test ; npm test $test ; done
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
golang:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Set up Go
uses: actions/setup-go@v2
if: always()
with:
go-version: 1.21
- name: Build
if: always()
run: |
go get github.com/onsi/ginkgo/ginkgo
go get github.com/onsi/gomega/...
go get -u github.com/dailymotion/allure-go
export ALLURE_RESULTS_PATH=allure-results
GCO_ENABLED=0
go mod vendor
echo "PWD"
echo $PWD
echo "GOPATH"
echo $GOPATH
echo "GOROOT"
echo $GOROOT
echo "ALLURE_RESULTS_PATH=$PWD" > "$PWD/variables.env"
go build -v ./...
- name: Test
if: always()
run: go test -v ./...
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
jdk:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Set up JDK 17
uses: actions/setup-java@v2
if: always()
with:
java-version: '17'
distribution: 'adopt'
- name: Run check style
uses: nikitasavinov/checkstyle-action@master
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
reporter: 'github-pr-check'
tool_name: 'testtool'
- name: Gradle wrapper
if: always()
run: gradle wrapper
- name: Print Gradle version
if: always()
run: gradle --version
- name: Grant execute permission for gradlew
if: always()
run: chmod +x gradlew
- name: Build with Gradle
if: always()
run: ./gradlew build --warning-mode all
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
# dotnet-format:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Add dotnet-format problem matcher
# uses: xt0rted/dotnet-format-problem-matcher@v1
# - name: Restore dotnet tools
# uses: xt0rted/dotnet-tool-restore@v1
# - name: Run dotnet format
# uses: xt0rted/dotnet-format@v1
# with:
# version: 5
# repo-token: ${{ secrets.GITHUB_TOKEN }}
dotnet:
runs-on: ubuntu-latest
needs:
- build
# - dotnet-format
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/allure-prep
- name: Setup .NET
uses: actions/setup-dotnet@v3
with:
dotnet-version: 8.0.x
- name: Restore dependencies
run: dotnet restore
# - name: Install dotnet-format
# run: |
# dotnet tool uninstall dotnet-format
# dotnet tool install dotnet-format --version "7.*" --add-source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet7/nuget/v3/index.json
# - name: Restore dotnet tools
# run: dotnet tool restore
- name: Check formatting
run: dotnet format --verify-no-changes -v d
- name: Build
run: dotnet build --no-restore
- name: Test
run: dotnet test --no-build --verbosity normal
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
# - name: Archive Allure reports
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-reports
# path: allure-reports
swift:
runs-on: macos-latest
needs: build
steps:
- uses: actions/checkout@v3
- name: Build
run: swift build -v
- name: Run tests
run: swift test -v
- name: Look at Allure
if: always()
uses: ./.github/actions/allure-show
# TODO: de-duplicate
- name: Archive Allure results
if: always()
uses: actions/upload-artifact@v2
with:
name: allure-results
path: allure-results
dart:
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v3
# Note: This workflow uses the latest stable version of the Dart SDK.
# You can specify other versions if desired, see documentation here:
# https://github.com/dart-lang/setup-dart/blob/main/README.md
# - uses: dart-lang/setup-dart@v1
- uses: dart-lang/setup-dart@v1
- name: Install dependencies
run: dart pub get
# Uncomment this step to verify the use of 'dart format' on each commit.
# - name: Verify formatting
# run: dart format --output=none --set-exit-if-changed .
# Consider passing '--fatal-infos' for slightly stricter analysis.
- name: Analyze project source
run: dart analyze
# Your project will need to have tests in test/ and a dependency on
# package:test for this step to succeed. Note that Flutter projects will
# want to change this to 'flutter test'.
- name: Run tests
# run: dart test
if: always()
# run: find -name '*_test.dart' | { read test; echo $test; pub run test $test; }
# run: find -name '*_test.dart' | while read test ; do echo $test ; pub run test $test ; done
run: find -name '*_test.dart' | while read test ; do echo $test ; dart run test $test ; done
# Allure is not yet supported
# - name: Look at Allure
# if: always()
# uses: ./.github/actions/allure-show
# # TODO: de-duplicate
# - name: Archive Allure results
# if: always()
# uses: actions/upload-artifact@v2
# with:
# name: allure-results
# path: allure-results
allure:
runs-on: ubuntu-latest
if: always()
needs:
# - build
- python
- ruby
- node
- golang
- jdk
- dotnet
- swift
- dart
steps:
- name: Download all workflow run artifacts
uses: actions/download-artifact@v2
- name: Get Allure history
uses: actions/checkout@v3
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Allure Report with history
uses: simple-elf/[email protected]
if: always()
- name: Allure Report action from marketplace
uses: simple-elf/allure-report-action@master
if: always()
#id: allure-report
with:
allure_results: allure-results
gh_pages: gh-pages
allure_report: allure-report
allure_history: allure-history
keep_reports: 50
- name: Deploy report to Github Pages
if: always()
uses: peaceiris/actions-gh-pages@v2
env:
PERSONAL_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PUBLISH_BRANCH: gh-pages
PUBLISH_DIR: allure-history
# dotnet-format:
# runs-on: ubuntu-latest
# steps:
# - name: Checkout repo
# uses: actions/checkout@v3
# - name: Add dotnet-format problem matcher
# uses: xt0rted/dotnet-format-problem-matcher@v1
# - name: Restore dotnet tools
# uses: xt0rted/dotnet-tool-restore@v1
# - name: Run dotnet format
# uses: xt0rted/dotnet-format@v1
# with:
# repo-token: ${{ secrets.GITHUB_TOKEN }}