-
Notifications
You must be signed in to change notification settings - Fork 218
131 lines (128 loc) · 3.91 KB
/
ci.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
name: CI
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
jobs:
console:
name: ci-console
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./hermes-console
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Setup node
uses: actions/setup-node@v4
with:
node-version: 20
- name: Run linter
run: yarn && yarn lint
- name: Run frontend tests
run: yarn test:unit
- name: Upload artifact
if: always() && github.ref == 'refs/heads/master'
uses: actions/upload-artifact@v4
with:
name: ci-console
path: ./hermes-console/allure-results
build:
runs-on: ubuntu-latest
strategy:
matrix:
tasks: [
# Add/remove task in Allure Report job also
{alias: "unitTests", name: "check"},
{alias: "integrationTests", name: "integrationTest"},
{alias: "slowIntegrationTests", name: "slowIntegrationTest"},
{alias: "benchmark", name: "jmh -Pjmh.iterations=1 -Pjmh.timeOnIteration=5s -Pjmh.warmupIterations=0"}
]
fail-fast: false
name: ${{ matrix.tasks.alias }}
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Set up JDK 17
uses: actions/setup-java@v4
with:
java-version: 17
distribution: 'temurin'
- name: Setup Gradle
uses: gradle/gradle-build-action@v2
- name: Build with Gradle
run: ./gradlew assemble
- name: Run task with Gradle
run: ./gradlew ${{ matrix.tasks.name }}
- name: Archive task results
uses: actions/upload-artifact@v3
if: (success() || failure()) && matrix.tasks.alias != 'benchmark'
with:
name: ${{ matrix.tasks.name }}-test-report
path: '**/build/test-results/**/TEST-*.xml'
retention-days: 90
- name: Generate test summary
uses: test-summary/action@v2
if: success() || failure()
with:
paths: '**/build/test-results/**/TEST-*.xml'
show: fail, skip
- name: Upload artifact
if: always() && github.ref == 'refs/heads/master' && matrix.tasks.alias != 'benchmark'
uses: actions/upload-artifact@v4
with:
name: ${{ matrix.tasks.alias }}
path: build/allure-results
allureReport:
if: always() && github.ref == 'refs/heads/master'
name: Generate Allure Report
needs: [ build, console ]
runs-on: ubuntu-latest
steps:
- name: Download artifact unitTests
uses: actions/download-artifact@v4
if: always()
with:
name: unitTests
path: allure-results
- name: Download artifact integrationTests
uses: actions/download-artifact@v4
if: always()
with:
name: integrationTests
path: allure-results
- name: Download artifact slowIntegrationTests
uses: actions/download-artifact@v4
if: always()
with:
name: slowIntegrationTests
path: allure-results
- name: Download artifact ci-console
uses: actions/download-artifact@v4
if: always()
with:
name: ci-console
path: allure-results
- name: Load test report history
uses: actions/checkout@v4
if: always()
continue-on-error: true
with:
ref: gh-pages
path: gh-pages
- name: Build test report
uses: simple-elf/[email protected]
if: always()
with:
gh_pages: gh-pages
allure_history: allure-history
allure_results: allure-results
- name: Publish test report
uses: peaceiris/actions-gh-pages@v4
if: always()
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_branch: gh-pages
publish_dir: allure-history