-
Notifications
You must be signed in to change notification settings - Fork 39
227 lines (204 loc) · 6.67 KB
/
tests.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
name: Tests
on:
workflow_dispatch:
pull_request:
types: [opened, synchronize, reopened, ready_for_review]
branches:
- master
- 'v[0-9]+\.[0-9]+-dev'
push:
branches:
- master
- 'v[0-9]+\.[0-9]+-dev'
schedule:
- cron: "30 4 * * *"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
changes:
name: Determine changed packages
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
outputs:
js-packages: ${{ steps.filter-js.outputs.changes }}
rs-packages: ${{ steps.filter-rs.outputs.changes }}
steps:
- name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
- uses: dorny/paths-filter@v2
id: filter-js
with:
filters: .github/package-filters/js-packages.yml
- uses: dorny/paths-filter@v2
id: filter-rs
with:
filters: .github/package-filters/rs-packages.yml
build-js:
name: Build JS packages
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
secrets: inherit
uses: ./.github/workflows/tests-build-js.yml
build-images:
name: Build Docker images
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
secrets: inherit
strategy:
fail-fast: false
matrix:
include:
- name: Drive
image_name: drive
target: drive-abci
- name: DAPI
image_name: dapi
target: dapi
- name: Dashmate helper
image_name: dashmate-helper
target: dashmate-helper
uses: ./.github/workflows/tests-build-image.yml
with:
name: ${{ matrix.name }}
image_name: ${{ matrix.image_name }}
target: ${{ matrix.target }}
rs-packages:
name: Rust packages
needs:
- changes
secrets: inherit
strategy:
fail-fast: false
matrix:
rs-package: ${{ fromJson(needs.changes.outputs.rs-packages) }}
uses: ./.github/workflows/tests-rs-package.yml
with:
package: ${{ matrix.rs-package }}
check-each-feature: ${{ contains(fromJSON('["dash-sdk","rs-dapi-client","dapi-grpc","dpp","drive-abci"]'), matrix.rs-package) }}
rs-crates-security:
name: Rust crates security audit
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup sccache
uses: ./.github/actions/sccache
with:
bucket: ${{ vars.CACHE_S3_BUCKET }}
region: ${{ vars.CACHE_REGION }}
endpoint: ${{ vars.CACHE_S3_ENDPOINT }}
access_key_id: ${{ secrets.CACHE_KEY_ID }}
secret_access_key: ${{ secrets.CACHE_SECRET_KEY }}
- name: Audit crates
uses: rustsec/audit-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
js-packages:
name: JS packages
needs:
- changes
- build-js
secrets: inherit
strategy:
fail-fast: false
matrix:
js-package: ${{ fromJson(needs.changes.outputs.js-packages) }}
uses: ./.github/workflows/tests-js-package.yml
with:
package: ${{ matrix.js-package }}
test-command: ${{ matrix.js-package == 'dashmate' && 'test:unit' || 'test' }}
skip-tests: ${{ contains(matrix.js-package, 'platform-test-suite') }}
js-deps-versions:
name: JS dependency versions check
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Setup Node.JS
uses: actions/setup-node@v4
with:
node-version: "20"
- name: Enable corepack
run: corepack enable
- name: Validate workspaces
run: yarn constraints
js-npm-security:
name: JS NPM security audit
if: ${{ github.event_name == 'push' || github.event_name == 'workflow_dispatch' || github.event_name == 'schedule' || !github.event.pull_request.draft }}
runs-on: ubuntu-24.04
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Enable corepack
run: corepack enable
- name: Audit NPM
run: yarn npm audit --environment production --all --recursive
js-codeql:
name: JS code security audit
needs: build-js
secrets: inherit
uses: ./.github/workflows/tests-codeql.yml
dashmate-e2e-tests:
name: Dashmate E2E tests
secrets: inherit
needs:
- changes
- build-js
- build-images
strategy:
fail-fast: false
matrix:
include:
- name: Local network
test-pattern: test/e2e/localNetwork.spec.js
restore_local_network_data: true
- name: Testnet fullnode
test-pattern: test/e2e/testnetFullnode.spec.js
restore_local_network_data: false
- name: Testnet Evonode
test-pattern: test/e2e/testnetEvonode.spec.js
restore_local_network_data: false
uses: ./.github/workflows/tests-dashmate.yml
with:
name: ${{ matrix.name }}
test-pattern: ${{ matrix.test-pattern }}
restore_local_network_data: ${{ matrix.restore_local_network_data }}
if: contains(needs.changes.outputs.js-packages, 'dashmate')
test-suite:
name: Test Suite
needs:
- build-js
- build-images
secrets: inherit
strategy:
fail-fast: false
matrix:
include:
- name: Test Suite
command: test:suite
batch_index: 0
batch_total: 0
- name: Test Suite in browser (1)
command: test:browsers
batch_index: 0
batch_total: 2
- name: Test Suite in browser (2)
command: test:browsers
batch_index: 1
batch_total: 2
uses: ./.github/workflows/tests-test-suite.yml
with:
name: ${{ matrix.name }}
command: ${{ matrix.command }}
batch_total: ${{ matrix.batch_total }}
batch_index: ${{ matrix.batch_index }}
test-functional:
name: Packages functional tests
needs:
- build-js
- build-images
secrets: inherit
uses: ./.github/workflows/tests-packges-functional.yml