This repository was archived by the owner on Dec 21, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 9
240 lines (232 loc) · 6.88 KB
/
test-build.yml
File metadata and controls
240 lines (232 loc) · 6.88 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
# Any tests that need the built code should go in here.
name: Test Build
# Be sure to update both workflow files if you edit any env or trigger config
env:
CI: true
DEBUG_COLORS: true
DEBUG: "Streamr*"
on:
push:
tags:
- "*"
branches:
- master
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.editorconfig'
- 'typedoc.js'
pull_request:
branches:
- "*"
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.editorconfig'
- 'typedoc.js'
schedule:
# run every day at 00:00
- cron: "0 0 * * *"
# Be sure to update both workflow files if you edit any env or trigger config
jobs:
init:
runs-on: ubuntu-latest
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.8.0
with:
access_token: ${{ github.token }}
build:
name: Run build using Node 14.x
runs-on: ubuntu-latest
env:
BUNDLE_ANALYSIS: true
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- name: npm ci
run: npm ci
- name: npm run build
run: npm run build
- uses: actions/upload-artifact@v2
with:
name: build
path: dist
test-exports:
name: Test Exports using Node 14.x
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: npm ci
run: npm ci
- name: test-types
run: npm run test-types
- name: npm run test-exports
run: npm run test-exports
browser-realtime:
name: Test Browser Realtime
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: npm ci
run: npm ci
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis core-api cassandra parity-node0 parity-sidechain-node0 bridge brokers trackers nginx smtp"
- uses: nick-invision/retry@v2
name: Run Realtime Test
with:
max_attempts: 3
timeout_minutes: 3
retry_on: error
command: npm run test-browser-realtime
browser-resend:
name: Test Browser Realtime + Resend
runs-on: ubuntu-latest
needs: build
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: "14.x"
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: npm ci
run: npm ci
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis core-api cassandra parity-node0 parity-sidechain-node0 bridge brokers trackers nginx smtp"
- uses: nick-invision/retry@v2
name: Run Resend Test
with:
max_attempts: 3
timeout_minutes: 3
retry_on: error
command: npm run test-browser-resend
benchmarks:
name: Test Benchmark using Node ${{ matrix.node-version }}
runs-on: ubuntu-latest
needs: build
strategy:
matrix:
node-version: [12.x, 14.x]
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis core-api cassandra parity-node0 parity-sidechain-node0 bridge brokers trackers nginx smtp"
- name: npm ci
run: npm ci
- name: benchmarks
run: npm run benchmarks > benchmarks.txt
- uses: actions/upload-artifact@v2
with:
name: benchmarks
path: benchmarks.txt
streamr-client-testing-tool:
name: ${{ matrix.config-name }} ${{ matrix.test-name }}
needs: build
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
test-name:
- stream-cleartext-unsigned
- stream-cleartext-signed
- stream-encrypted-shared-signed
- stream-encrypted-shared-rotating-signed
- stream-encrypted-exchanged-rotating-signed
- stream-encrypted-exchanged-rotating-revoking-signed
config-name:
- default
- js-only
- java-only
- realtime-only
- js-realtime-only
- java-realtime-only
env:
NUM_MESSAGES: 20
TEST_NAME: ${{ matrix.test-name }}
CONFIG_NAME: ${{ matrix.config-name }}
LOG_LEVEL_JAVA_CLIENT: 'debug'
LOG_LEVEL_PUBLISHER_JS: 'debug'
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v2
with:
node-version: "14.x"
- uses: actions/download-artifact@v2
with:
name: build
path: dist
- name: Start Streamr Docker Stack
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
with:
services-to-start: "mysql redis core-api cassandra parity-node0 parity-sidechain-node0 bridge brokers trackers nginx smtp"
- name: npm ci
run: npm ci
- name: npm link
run: cd dist && npm link
- uses: actions/checkout@v2
with:
repository: streamr-dev/streamr-client-testing
path: streamr-client-testing
- uses: actions/setup-java@v1
with:
java-version: '8'
- name: setup-client-testing
working-directory: streamr-client-testing
run: |
## npm install is used because package-lock.json could be from a previous client version.
npm install
npm link streamr-client
./gradlew fatjar
- uses: nick-invision/retry@v2
name: run-client-testing
with:
max_attempts: 5
timeout_minutes: 15
retry_on: error
command: cd streamr-client-testing && DEBUG='' java -jar build/libs/client_testing-1.0-SNAPSHOT.jar -s $TEST_NAME -c config/$CONFIG_NAME.conf -n $NUM_MESSAGES
- name: Collect docker logs on failure
if: failure()
uses: jwalton/gh-docker-logs@v1
with:
dest: './logs'
- name: Upload logs to GitHub
if: failure()
uses: actions/upload-artifact@master
with:
name: docker-logs-${{ github.job }}-${{ github.run_number }}-${{ github.run_id }}
path: ./logs