Skip to content
This repository was archived by the owner on Dec 21, 2021. It is now read-only.

Commit e8e13f0

Browse files
committed
Split main CI workflow into test-build & test-code workflows.
1 parent 5306be0 commit e8e13f0

File tree

2 files changed

+140
-103
lines changed

2 files changed

+140
-103
lines changed

.github/workflows/nodejs.yml renamed to .github/workflows/test-build.yml

Lines changed: 5 additions & 103 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,7 @@
1-
name: Lint, Unit, Integration Tests
1+
# Any tests that need the built code should go in here.
2+
name: Test Build
3+
4+
# Be sure to update both workflow files if you edit any env or trigger config
25
env:
36
CI: true
47
DEBUG_COLORS: true
@@ -25,6 +28,7 @@ on:
2528
schedule:
2629
# run every day at 00:00
2730
- cron: "0 0 * * *"
31+
# Be sure to update both workflow files if you edit any env or trigger config
2832

2933
jobs:
3034
build:
@@ -46,108 +50,6 @@ jobs:
4650
name: build
4751
path: dist
4852

49-
lint:
50-
name: Run linter using Node 14.x
51-
runs-on: ubuntu-latest
52-
steps:
53-
- uses: actions/checkout@v2
54-
- uses: actions/setup-node@v2
55-
with:
56-
node-version: "14.x"
57-
- name: npm ci
58-
run: npm ci
59-
- name: npm run eslint
60-
run: npm run eslint
61-
62-
test:
63-
name: Test Unit using Node ${{ matrix.node-version }}
64-
runs-on: ubuntu-latest
65-
strategy:
66-
matrix:
67-
node-version: [12.x, 14.x]
68-
env:
69-
TEST_REPEATS: 5
70-
steps:
71-
- uses: actions/checkout@v2
72-
- uses: actions/setup-node@v2
73-
with:
74-
node-version: ${{ matrix.node-version }}
75-
- name: npm ci
76-
run: npm ci
77-
- name: test-unit
78-
timeout-minutes: 7
79-
run: npm run test-unit
80-
81-
integration:
82-
name: ${{ matrix.test-name }} ${{ matrix.websocket-url.name }} using Node ${{ matrix.node-version }}
83-
runs-on: ubuntu-latest
84-
strategy:
85-
fail-fast: false
86-
matrix:
87-
node-version: [12.x, 14.x]
88-
test-name: [
89-
"test-integration-no-resend",
90-
"test-integration-resend",
91-
"test-integration-dataunions",
92-
]
93-
websocket-url:
94-
- name: "default"
95-
url: ""
96-
- name: "storage-node-only"
97-
url: "ws://localhost:8890/api/v1/ws"
98-
99-
exclude:
100-
# no need to test different ws urls for dataunion tests
101-
- test-name: "test-integration-dataunions"
102-
websocket-url:
103-
- name: "storage-node-only"
104-
- url: "ws://localhost:8890/api/v1/ws"
105-
env:
106-
TEST_NAME: ${{ matrix.test-name }}
107-
WEBSOCKET_URL: ${{ matrix.websocket-url.url}}
108-
TEST_REPEATS: 2
109-
110-
steps:
111-
- uses: actions/checkout@v2
112-
- uses: actions/setup-node@v2
113-
with:
114-
node-version: ${{ matrix.node-version }}
115-
- name: npm ci
116-
run: npm ci
117-
- name: Start Streamr Docker Stack
118-
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
119-
with:
120-
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
121-
- name: Run Test
122-
run: npm run $TEST_NAME
123-
124-
flakey:
125-
name: Flakey Tests using Node ${{ matrix.node-version }}
126-
runs-on: ubuntu-latest
127-
strategy:
128-
fail-fast: false
129-
matrix:
130-
node-version: [12.x, 14.x]
131-
132-
steps:
133-
- uses: actions/checkout@v2
134-
- uses: actions/setup-node@v2
135-
with:
136-
node-version: ${{ matrix.node-version }}
137-
- name: npm ci
138-
run: npm ci
139-
- name: Start Streamr Docker Stack
140-
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
141-
with:
142-
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
143-
- uses: nick-invision/retry@v2
144-
name: Run Test
145-
with:
146-
max_attempts: 2
147-
timeout_minutes: 15
148-
retry_on: error
149-
command: npm run test-flakey || echo "::warning::Flakey Tests Failed"
150-
15153
test-exports:
15254
name: Test Exports using Node 14.x
15355
runs-on: ubuntu-latest

.github/workflows/test-code.yml

Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
# Any tests that can run without building should go in here.
2+
name: Lint, Unit, Integration Tests
3+
4+
# Be sure to update both workflow files if you edit any env or trigger config
5+
env:
6+
CI: true
7+
DEBUG_COLORS: true
8+
DEBUG: "Streamr*"
9+
on:
10+
push:
11+
tags:
12+
- "*"
13+
branches:
14+
- master
15+
paths-ignore:
16+
- 'README.md'
17+
- 'LICENSE'
18+
- '.editorconfig'
19+
- 'typedoc.js'
20+
pull_request:
21+
branches:
22+
- "*"
23+
paths-ignore:
24+
- 'README.md'
25+
- 'LICENSE'
26+
- '.editorconfig'
27+
- 'typedoc.js'
28+
schedule:
29+
# run every day at 00:00
30+
- cron: "0 0 * * *"
31+
# Be sure to update both workflow files if you edit any env or trigger config
32+
33+
jobs:
34+
lint:
35+
name: Run linter using Node 14.x
36+
runs-on: ubuntu-latest
37+
steps:
38+
- uses: actions/checkout@v2
39+
- uses: actions/setup-node@v2
40+
with:
41+
node-version: "14.x"
42+
- name: npm ci
43+
run: npm ci
44+
- name: npm run eslint
45+
run: npm run eslint
46+
47+
test:
48+
name: Test Unit using Node ${{ matrix.node-version }}
49+
runs-on: ubuntu-latest
50+
strategy:
51+
matrix:
52+
node-version: [12.x, 14.x]
53+
env:
54+
TEST_REPEATS: 5
55+
steps:
56+
- uses: actions/checkout@v2
57+
- uses: actions/setup-node@v2
58+
with:
59+
node-version: ${{ matrix.node-version }}
60+
- name: npm ci
61+
run: npm ci
62+
- name: test-unit
63+
timeout-minutes: 7
64+
run: npm run test-unit
65+
66+
integration:
67+
name: ${{ matrix.test-name }} ${{ matrix.websocket-url.name }} using Node ${{ matrix.node-version }}
68+
runs-on: ubuntu-latest
69+
strategy:
70+
fail-fast: false
71+
matrix:
72+
node-version: [12.x, 14.x]
73+
test-name: [
74+
"test-integration-no-resend",
75+
"test-integration-resend",
76+
"test-integration-dataunions",
77+
]
78+
websocket-url:
79+
- name: "default"
80+
url: ""
81+
- name: "storage-node-only"
82+
url: "ws://localhost:8890/api/v1/ws"
83+
84+
exclude:
85+
# no need to test different ws urls for dataunion tests
86+
- test-name: "test-integration-dataunions"
87+
websocket-url:
88+
- name: "storage-node-only"
89+
- url: "ws://localhost:8890/api/v1/ws"
90+
env:
91+
TEST_NAME: ${{ matrix.test-name }}
92+
WEBSOCKET_URL: ${{ matrix.websocket-url.url}}
93+
TEST_REPEATS: 2
94+
95+
steps:
96+
- uses: actions/checkout@v2
97+
- uses: actions/setup-node@v2
98+
with:
99+
node-version: ${{ matrix.node-version }}
100+
- name: npm ci
101+
run: npm ci
102+
- name: Start Streamr Docker Stack
103+
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
104+
with:
105+
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
106+
- name: Run Test
107+
run: npm run $TEST_NAME
108+
109+
flakey:
110+
name: Flakey Tests using Node ${{ matrix.node-version }}
111+
runs-on: ubuntu-latest
112+
strategy:
113+
fail-fast: false
114+
matrix:
115+
node-version: [12.x, 14.x]
116+
117+
steps:
118+
- uses: actions/checkout@v2
119+
- uses: actions/setup-node@v2
120+
with:
121+
node-version: ${{ matrix.node-version }}
122+
- name: npm ci
123+
run: npm ci
124+
- name: Start Streamr Docker Stack
125+
uses: streamr-dev/streamr-docker-dev-action@v1.0.0-alpha.3
126+
with:
127+
services-to-start: "mysql redis engine-and-editor cassandra parity-node0 parity-sidechain-node0 bridge broker-node-storage-1 nginx smtp"
128+
- uses: nick-invision/retry@v2
129+
name: Run Test
130+
with:
131+
max_attempts: 2
132+
timeout_minutes: 15
133+
retry_on: error
134+
command: npm run test-flakey || echo "::warning::Flakey Tests Failed"
135+

0 commit comments

Comments
 (0)