Skip to content

Commit a11b52b

Browse files
vid277cdxker
authored andcommitted
feature: add upload docker image artifacts
1 parent c0e86c5 commit a11b52b

1 file changed

Lines changed: 130 additions & 12 deletions

File tree

.github/workflows/integ-tests.yml

Lines changed: 130 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,47 @@ on:
66
branches: [main]
77

88
jobs:
9+
build:
10+
runs-on: blacksmith-16vcpu-ubuntu-2204
11+
steps:
12+
- name: Checkout repository
13+
uses: actions/checkout@v4
14+
15+
- name: Cache Rust dependencies
16+
uses: useblacksmith/cache@v5
17+
with:
18+
path: |
19+
~/.cargo/registry
20+
~/.cargo/git
21+
target
22+
key: ${{ runner.os }}-cargo-e2e-${{ hashFiles('**/Cargo.toml') }}
23+
24+
- name: Set up Rust toolchain
25+
run: |
26+
rustup update 1.87
27+
rustup default 1.87
28+
29+
- name: Install dependencies
30+
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
31+
32+
- name: Build Docker image
33+
run: |
34+
docker build -t thevalut-node:test .
35+
36+
- name: Save Docker image
37+
run: |
38+
docker save thevalut-node:test | gzip > thevalut-node-test.tar.gz
39+
40+
- name: Upload Docker image artifact
41+
uses: actions/upload-artifact@v4
42+
with:
43+
name: thevalut-node-test-image
44+
path: thevalut-node-test.tar.gz
45+
retention-days: 1
46+
947
dkg_test-12:
1048
runs-on: blacksmith-16vcpu-ubuntu-2204
49+
needs: build
1150
env:
1251
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
1352
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -30,6 +69,16 @@ jobs:
3069
rustup update 1.87
3170
rustup default 1.87
3271
72+
- name: Download Docker image artifact
73+
uses: actions/download-artifact@v4
74+
with:
75+
name: thevalut-node-test-image
76+
path: .
77+
78+
- name: Load Docker image
79+
run: |
80+
gunzip -c thevalut-node-test.tar.gz | docker load
81+
3382
- name: Install dependencies
3483
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
3584

@@ -65,6 +114,7 @@ jobs:
65114

66115
dkg_test_5:
67116
runs-on: blacksmith-16vcpu-ubuntu-2204
117+
needs: build
68118
env:
69119
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
70120
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -87,6 +137,16 @@ jobs:
87137
rustup update 1.87
88138
rustup default 1.87
89139
140+
- name: Download Docker image artifact
141+
uses: actions/download-artifact@v4
142+
with:
143+
name: thevalut-node-test-image
144+
path: .
145+
146+
- name: Load Docker image
147+
run: |
148+
gunzip -c thevalut-node-test.tar.gz | docker load
149+
90150
- name: Install dependencies
91151
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
92152

@@ -95,7 +155,7 @@ jobs:
95155

96156
- name: Start 5-node stack (docker-compose)
97157
run: |
98-
docker compose -f docker-compose.yaml up -d --build
158+
docker compose -f docker-compose.yaml up -d
99159
100160
- name: Wait for gRPC endpoint
101161
run: |
@@ -114,6 +174,7 @@ jobs:
114174

115175
end-to-end-deposit-withdrawl:
116176
runs-on: blacksmith-16vcpu-ubuntu-2204
177+
needs: build
117178
env:
118179
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
119180
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -136,14 +197,25 @@ jobs:
136197
rustup update 1.87
137198
rustup default 1.87
138199
200+
- name: Download Docker image artifact
201+
uses: actions/download-artifact@v4
202+
with:
203+
name: thevalut-node-test-image
204+
path: .
205+
206+
- name: Load Docker image
207+
run: |
208+
gunzip -c thevalut-node-test.tar.gz | docker load
209+
210+
- name: Clean cargo
211+
run: cargo clean
212+
139213
- name: Install dependencies
140214
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
141215

142-
- run: cargo clean
143-
144216
- name: Start 5-node stack (docker-compose)
145217
run: |
146-
docker compose -f docker-compose.yaml up -d --build
218+
docker compose -f docker-compose.yaml up -d
147219
148220
- name: Wait for gRPC endpoint
149221
run: |
@@ -167,6 +239,7 @@ jobs:
167239
168240
dkg_test_chaos_network:
169241
runs-on: blacksmith-16vcpu-ubuntu-2204
242+
needs: build
170243
env:
171244
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
172245
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -189,15 +262,25 @@ jobs:
189262
rustup update 1.87
190263
rustup default 1.87
191264
265+
- name: Download Docker image artifact
266+
uses: actions/download-artifact@v4
267+
with:
268+
name: thevalut-node-test-image
269+
path: .
270+
192271
- name: Install dependencies
193272
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
194273

274+
- name: Load Docker image
275+
run: |
276+
gunzip -c thevalut-node-test.tar.gz | docker load
277+
195278
- name: Create NodeCluster (3 nodes)
196279
run: ./scripts/clear_dkg_keys.sh
197280

198281
- name: Start 5-node stack with network chaos
199282
run: |
200-
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml up -d --build
283+
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml up -d
201284
202285
- name: Wait for gRPC endpoint
203286
run: |
@@ -221,6 +304,7 @@ jobs:
221304
222305
dkg_test_chaos_nodes:
223306
runs-on: blacksmith-16vcpu-ubuntu-2204
307+
needs: build
224308
env:
225309
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
226310
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -243,15 +327,25 @@ jobs:
243327
rustup update 1.87
244328
rustup default 1.87
245329
330+
- name: Download Docker image artifact
331+
uses: actions/download-artifact@v4
332+
with:
333+
name: thevalut-node-test-image
334+
path: .
335+
246336
- name: Install dependencies
247337
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
248338

339+
- name: Load Docker image
340+
run: |
341+
gunzip -c thevalut-node-test.tar.gz | docker load
342+
249343
- name: Create NodeCluster (3 nodes)
250344
run: ./scripts/clear_dkg_keys.sh
251345

252346
- name: Start 5-node stack with node chaos
253347
run: |
254-
docker compose -f docker-compose.yaml -f docker-compose.chaos-nodes.yaml up -d --build
348+
docker compose -f docker-compose.yaml -f docker-compose.chaos-nodes.yaml up -d
255349
256350
- name: Wait for gRPC endpoint
257351
run: |
@@ -275,6 +369,7 @@ jobs:
275369
276370
end-to-end-deposit-withdrawl-chaos-network:
277371
runs-on: blacksmith-16vcpu-ubuntu-2204
372+
needs: build
278373
env:
279374
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
280375
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -297,14 +392,25 @@ jobs:
297392
rustup update 1.87
298393
rustup default 1.87
299394
395+
- name: Download Docker image artifact
396+
uses: actions/download-artifact@v4
397+
with:
398+
name: thevalut-node-test-image
399+
path: .
400+
401+
- name: Load Docker image
402+
run: |
403+
gunzip -c thevalut-node-test.tar.gz | docker load
404+
405+
- name: Clean cargo
406+
run: cargo clean
407+
300408
- name: Install dependencies
301409
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
302410

303-
- run: cargo clean
304-
305411
- name: Start 5-node stack with network chaos
306412
run: |
307-
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml up -d --build
413+
docker compose -f docker-compose.yaml -f docker-compose.chaos-network.yaml up -d
308414
309415
- name: Wait for gRPC endpoint
310416
run: |
@@ -328,6 +434,7 @@ jobs:
328434
329435
end-to-end-deposit-withdrawl-chaos-nodes:
330436
runs-on: blacksmith-16vcpu-ubuntu-2204
437+
needs: build
331438
env:
332439
MNEMONIC: ${{ secrets.TEST_MNEMONIC }}
333440
MNEMONIC_TO: ${{ secrets.TEST_MNEMONIC_TO }}
@@ -350,14 +457,25 @@ jobs:
350457
rustup update 1.87
351458
rustup default 1.87
352459
460+
- name: Download Docker image artifact
461+
uses: actions/download-artifact@v4
462+
with:
463+
name: thevalut-node-test-image
464+
path: .
465+
466+
- name: Load Docker image
467+
run: |
468+
gunzip -c thevalut-node-test.tar.gz | docker load
469+
470+
- name: Clean cargo
471+
run: cargo clean
472+
353473
- name: Install dependencies
354474
run: sudo apt-get update && sudo apt-get install -y protobuf-compiler libclang-dev clang
355475

356-
- run: cargo clean
357-
358476
- name: Start 5-node stack with node chaos
359477
run: |
360-
docker compose -f docker-compose.yaml -f docker-compose.chaos-nodes.yaml up -d --build
478+
docker compose -f docker-compose.yaml -f docker-compose.chaos-nodes.yaml up -d
361479
362480
- name: Wait for gRPC endpoint
363481
run: |

0 commit comments

Comments
 (0)