-
Notifications
You must be signed in to change notification settings - Fork 83
1043 lines (984 loc) · 41.3 KB
/
main.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
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
name: CI
on:
push:
branches:
- main
pull_request:
branches:
- "**"
env:
DOCKER_BUILDKIT: 1
MAIN_BRANCH: main
URL_DOCKER_REGISTRY: ghcr.io
DOCKER_IMAGE_AGENCY: ghcr.io/absaoss/vcxagencynode/vcxagency-node:2.6.0
DOCKER_IMAGE_POOL: ghcr.io/hyperledger/aries-vcx/indy_pool_localhost:1.15.0
DOCKER_REPO_LOCAL_ALPINE_CORE: alpine-core
DOCKER_REPO_LOCAL_LIBVCX: libvcx
DOCKER_REPO_LOCAL_ANDROID: android-test
DOCKER_REPO_LOCAL_VDRPROXY: vdrproxy
RUST_TOOLCHAIN_VERSON: 1.65.0
NODE_VERSION: 18.x
jobs:
verify-code-formatting:
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
components: rustfmt, clippy
- name: "Verify code formatting"
run: |
cargo fmt --check
workflow-setup:
runs-on: ubuntu-20.04
outputs:
PUBLISH_VERSION: ${{ steps.run-info.outputs.publish-version }}
RELEASE: ${{ steps.run-info.outputs.release }}
PRERELEASE: ${{ steps.run-info.outputs.pre-release }}
BRANCH_NAME: ${{ steps.run-info.outputs.branch-name }}
IS_FORK: ${{ steps.run-info.outputs.is-fork }}
SKIP_IOS: ${{ steps.skip-info.outputs.skip-ios }}
SKIP_ANDROID: ${{ steps.skip-info.outputs.skip-android }}
SKIP_NAPI_M1: ${{ steps.skip-info.outputs.skip-napi-m1 }}
SKIP_CI: ${{ steps.skip-info.outputs.skip-ci }}
DOCKER_IMG_CACHED_ALPINE_CORE: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}
DOCKER_IMG_CACHED_LIBVCX: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_LIBVCX }}
DOCKER_IMG_CACHED_ANDROID: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_ANDROID }}
DOCKER_IMG_CACHED_VDRPROXY: ${{ steps.docker-imgs.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
steps:
- name: "Git checkout"
uses: actions/checkout@v1
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
- name: "Construct CI run-info"
id: run-info
uses: ./.github/actions/construct-run-info
- name: "Detect CI skip steps"
id: skip-info
uses: ./.github/actions/detect-skip-info
- name: "Set outputs"
id: docker-imgs
run: |
set -x
HASH_DOCKERFILE_ALPINE_CORE=${{ hashFiles('ci/alpine_core.dockerfile')}}
HASH_DOCKERFILE_LIBVCX=${{ hashFiles('ci/libvcx.dockerfile') }}
HASH_DOCKERFILE_VDRPROXY=${{ hashFiles('ci/vdrproxy.dockerfile') }}
HASH_SRC_LIBVDRTOOLS=${{ hashFiles('libvdrtools') }}
HASH_SRC_LIBVCX=${{ hashFiles('libvcx') }}
HASH_SRC_ARIESVCX=${{ hashFiles('aries_vcx') }}
HASH_SRC_ARIESVCX_CORE=${{ hashFiles('aries_vcx_core') }}
HASH_SRC_AGENCYCLIENT=${{ hashFiles('agency_client') }}
HASH_SRC_DIDDOC=${{ hashFiles('diddoc') }}
HASH_SRC_MESSAGES=${{ hashFiles('messages') }}
HASH_SRC_WRAPPER_JAVA=${{ hashFiles('wrappers/java') }}
SEED_HASH_ARIESVCX=${HASH_SRC_LIBVDRTOOLS:0:11}-${HASH_SRC_ARIESVCX_CORE:0:11}-${HASH_SRC_ARIESVCX:0:11}-${HASH_SRC_AGENCYCLIENT:0:11}-${HASH_SRC_DIDDOC:0:11}-${HASH_SRC_MESSAGES:0:11}}
HASH_ARIESVCX=$(echo -n "$SEED_HASH_ARIESVCX" | sha256sum | awk '{print $1}')
SEED_HASH_DOCKER_LIBVCX=${HASH_ARIESVCX:0:11}-${HASH_DOCKERFILE_LIBVCX:0:11}-${HASH_SRC_LIBVCX:0:11}
HASH_DOCKER_LIBVCX=$(echo -n "$SEED_HASH_DOCKER_LIBVCX" | sha256sum | awk '{print $1}')
SEED_HASH_DOCKER_ANDROID=${HASH_ARIESVCX:0:11}-${HASH_DOCKER_LIBVCX:0:11}-${HASH_SRC_WRAPPER_JAVA:0:11}
HASH_DOCKER_ANDROID=$(echo -n "$SEED_HASH_DOCKER_ANDROID" | sha256sum | awk '{print $1}')
echo "DOCKER_IMG_CACHED_ALPINE_CORE=$DOCKER_REPO_LOCAL_ALPINE_CORE:$HASH_DOCKERFILE_ALPINE_CORE" >> $GITHUB_OUTPUT
echo "DOCKER_IMG_CACHED_LIBVCX=$DOCKER_REPO_LOCAL_LIBVCX:$HASH_DOCKER_LIBVCX" >> $GITHUB_OUTPUT
echo "DOCKER_IMG_CACHED_ANDROID=$DOCKER_REPO_LOCAL_ANDROID:$HASH_DOCKER_ANDROID" >> $GITHUB_OUTPUT
echo "DOCKER_IMG_CACHED_VDRPROXY=$DOCKER_REPO_LOCAL_VDRPROXY:$HASH_DOCKERFILE_VDRPROXY" >> $GITHUB_OUTPUT
workflow-setup-check:
runs-on: ubuntu-20.04
needs: workflow-setup
steps:
- name: "Print outputs"
run: |
echo "PUBLISH_VERSION ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}"
echo "RELEASE ${{ needs.workflow-setup.outputs.RELEASE }}"
echo "PRERELEASE ${{ needs.workflow-setup.outputs.PRERELEASE }}"
echo "BRANCH_NAME ${{ needs.workflow-setup.outputs.BRANCH_NAME }}"
echo "IS_FORK ${{ needs.workflow-setup.outputs.IS_FORK }}"
echo "SKIP_IOS ${{ needs.workflow-setup.outputs.SKIP_IOS }}"
echo "SKIP_ANDROID ${{ needs.workflow-setup.outputs.SKIP_ANDROID }}"
echo "SKIP_NAPI_M1 ${{ needs.workflow-setup.outputs.SKIP_NAPI_M1 }}"
echo "SKIP_CI ${{ needs.workflow-setup.outputs.SKIP_CI }}"
echo "DOCKER_IMG_CACHED_ALPINE_CORE ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}"
echo "DOCKER_IMG_CACHED_LIBVCX ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }}"
echo "DOCKER_IMG_CACHED_ANDROID ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}"
echo "DOCKER_IMG_CACHED_VDRPROXY ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}"
clippy-aries-vcx:
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
components: rustfmt, clippy
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Verify clippy warnings"
run: |
cd aries_vcx && cargo clippy
clippy-libvcx:
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
components: rustfmt, clippy
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Verify clippy warnings"
run: |
cd libvcx && cargo clippy
check-did-resolver-feature-variants:
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Verify aries_vcx compiles with different dependency feature variants"
run: |
cd did_resolver_sov
cargo check
check-aries-vcx-feature-variants:
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
components: rustfmt, clippy
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Verify aries_vcx compiles with different dependency feature variants"
run: |
cd aries_vcx
cargo check --no-default-features
cargo check --tests --all-features
cargo check --features vdrtools --no-default-features
cargo check --features modular_libs --no-default-features
##########################################################################################
############################## DOCKER BUILD ##########################################
build-docker-alpine-core:
needs: workflow-setup
runs-on: ubuntu-20.04
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ env.URL_DOCKER_REGISTRY }}
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build and cache image"
uses: ./.github/actions/build-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
build-arg: "USER_ID=$UID"
dockerfile-path: "ci/alpine_core.dockerfile"
branch-name: ${{ env.BRANCH_NAME }}
branch-main: ${{ env.MAIN_BRANCH }}
docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_ALPINE_CORE }}
build-docker-libvcx:
needs: [ workflow-setup, build-docker-alpine-core ]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }}
DOCKER_IMG_CACHED_ALPINE_CORE: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ env.URL_DOCKER_REGISTRY }}
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Load alpine core image"
uses: ./.github/actions/load-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }}
- name: "Build and cache image"
uses: ./.github/actions/build-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE"
dockerfile-path: "ci/libvcx.dockerfile"
branch-name: ${{ env.BRANCH_NAME }}
branch-main: ${{ env.MAIN_BRANCH }}
docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_LIBVCX }}
build-docker-android:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true'}}
runs-on: ubuntu-20.04
env:
DOCKER_IMG_CACHED: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ env.URL_DOCKER_REGISTRY }}
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Build and cache image"
uses: ./.github/actions/build-image
with:
skip-build-optimization: true # prevent pulling "main" branch image, because it's taking up lot of disk space.
docker-img: ${{ env.DOCKER_IMG_CACHED }}
dockerfile-path: "wrappers/java/ci/android.dockerfile"
branch-name: ${{ env.BRANCH_NAME }}
branch-main: ${{ env.MAIN_BRANCH }}
docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_ANDROID }}
build-docker-vdrproxy:
needs: [ workflow-setup, build-docker-alpine-core ]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
env:
DOCKER_IMG_CACHED_ALPINE_CORE: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ALPINE_CORE }}
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
outputs:
image-name: ${{ steps.meta.outputs.tags }}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Load alpine core image"
uses: ./.github/actions/load-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED_ALPINE_CORE }}
- name: "Build and cache image"
uses: ./.github/actions/build-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
dockerfile-path: "ci/vdrproxy.dockerfile"
build-arg: "ALPINE_CORE_IMAGE=$DOCKER_IMG_CACHED_ALPINE_CORE"
branch-name: ${{ env.BRANCH_NAME }}
branch-main: ${{ env.MAIN_BRANCH }}
docker-repo-local-name: ${{ env.DOCKER_REPO_LOCAL_VDRPROXY }}
##########################################################################################
############################## DOCKER PUBLISH ########################################
publish-docker-vdrproxy:
runs-on: ubuntu-20.04
needs: [ workflow-setup, build-docker-vdrproxy ]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
IS_FORK: ${{ needs.workflow-setup.outputs.IS_FORK }}
steps:
- name: "Git checkout"
if: ${{ env.IS_FORK == 'false' }}
uses: actions/checkout@v3
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ env.URL_DOCKER_REGISTRY }}
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Publish versioned image"
if: ${{ env.IS_FORK == 'false' }}
uses: ./.github/actions/publish-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
publish-version: ${{ env.PUBLISH_VERSION }}
publish-docker-libvcx:
runs-on: ubuntu-20.04
needs: [ workflow-setup, build-docker-libvcx ]
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
DOCKER_IMG_CACHED: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_LIBVCX }}
PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
BRANCH_NAME: ${{ needs.workflow-setup.outputs.BRANCH_NAME }}
IS_FORK: ${{ needs.workflow-setup.outputs.IS_FORK }}
steps:
- name: "Git checkout"
if: ${{ env.IS_FORK == 'false' }}
uses: actions/checkout@v3
- name: "Docker Login"
uses: azure/docker-login@v1
with:
login-server: ${{ env.URL_DOCKER_REGISTRY }}
username: $GITHUB_ACTOR
password: ${{ secrets.GITHUB_TOKEN }}
- name: "Publish versioned image"
if: ${{ env.IS_FORK == 'false' }}
uses: ./.github/actions/publish-image
with:
docker-img: ${{ env.DOCKER_IMG_CACHED }}
publish-version: ${{ env.PUBLISH_VERSION }}
# ##########################################################################################
# ############################### CODECOV ###########################################
code-coverage-aries-vcx-integration-modular-libs:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust codecov environment"
uses: ./.github/actions/setup-codecov-rust
- name: "Run workspace tests: modular libs profile"
run: |
RUSTFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUSTDOCFLAGS='-Zprofile -Ccodegen-units=1 -Cinline-threshold=0 -Clink-dead-code -Coverflow-checks=off -Cpanic=abort -Zpanic_abort_tests' \
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --package aries-vcx -F 'modular_libs' -- --ignored;
mkdir -p /tmp/artifacts/coverage
grcov ./target/debug/ -s . -t lcov --llvm --branch --ignore-not-existing -o /tmp/artifacts/coverage/coverage.lcov
- name: "Upload coverage to Codecov"
uses: codecov/codecov-action@v2
with:
directory: /tmp/artifacts/coverage
flags: unittests-aries-vcx
name: codecov-unit-aries-vcx
fail_ci_if_error: true
path_to_write_report: /tmp/artifacts/coverage/codecov_report.gz
- uses: actions/upload-artifact@v3
with:
name: code-coverage-report-unit-aries-vcx
path: /tmp/artifacts/coverage
##########################################################################################
############################### TESTING ###########################################
test-unit-workspace:
needs: workflow-setup
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"anoncreds_vdrtools",
"anoncreds_credx",
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
with:
skip-docker-setup: true
- name: "Run workspace unit tests"
run: RUST_TEST_THREADS=1 cargo test --workspace --lib --exclude aries-vcx-agent --exclude libvdrtools --exclude wallet_migrator --features ${{ matrix.features }}
test-integration-aries-vcx:
needs: workflow-setup
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"vdrtools",
"modular_libs"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx integration tests"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" --features ${{ matrix.features }} -- --ignored;
test-integration-aries-vcx-mysql:
needs: workflow-setup
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx tests: mysql_test"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" test_mysql -- --include-ignored;
test-integration-aries-vcx-vdrproxy:
needs: [workflow-setup, build-docker-vdrproxy]
runs-on: ubuntu-20.04
env:
RUST_TEST_THREADS: 1
VDR_PROXY_CLIENT_URL: http://127.0.0.1:3030
DOCKER_IMAGE_VDRPROXY: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_VDRPROXY }}
GENESIS_URL: https://raw.githubusercontent.com/AbsaOSS/sovrin-networks/master/genesis/127.0.0.1
VDR_PROXY_PORT: 3030
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Load android image"
uses: ./.github/actions/load-image
with:
docker-img: ${{ env.DOCKER_IMAGE_VDRPROXY }}
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
with:
skip-vdrproxy-setup: false
- name: "Run aries-vcx tests: vdrproxy_test"
run: RUST_TEST_THREADS=1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F vdr_proxy_ledger -- --ignored
- name: "Collect docker logs on failure"
if: failure()
uses: ./.github/actions/upload-docker-logs
with:
name: "docker-services-${{ github.job }}"
test-integration-aries-vcx-migration:
needs: workflow-setup
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run aries-vcx tests: pool_tests agency_pool_tests"
run: |
cargo test --manifest-path="wallet_migrator/Cargo.toml";
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_creds_proofs -- --include-ignored;
RUST_TEST_THREADS=1 CARGO_INCREMENTAL=0 TEST_POOL_IP=127.0.0.1 cargo test --manifest-path="aries_vcx/Cargo.toml" -F migration --test test_creds_proofs_revocations -- --include-ignored;
test-integration-libvcx:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"anoncreds_vdrtools",
"anoncreds_credx"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run libvcx_core integration tests"
run: |
RUST_TEST_THREADS=1 cargo test --features ${{ matrix.features }} --manifest-path="libvcx_core/Cargo.toml" -- --include-ignored;
test-integration-libvcx-c:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
strategy:
matrix:
features: [
"anoncreds_vdrtools",
"anoncreds_credx"
]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run libvcx unit tests"
run: |
RUST_TEST_THREADS=1 cargo test --features ${{ matrix.features }} --manifest-path="libvcx/Cargo.toml";
test-integration-resolver:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup rust testing environment"
uses: ./.github/actions/setup-testing-rust
- name: "Run resolver tests"
run: |
RUST_TEST_THREADS=1 cargo test -p did_doc -p did_parser -p did_resolver -p did_resolver_registry -p did_resolver_sov -p did_resolver_web --test "*"
test-node-wrapper:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup NodeJS libvcx testing environment"
uses: ./.github/actions/setup-testing-nodejs
with:
skip-docker-setup: true
node-version: ${{ matrix.node-version }}
- name: "Run tests"
run: cd wrappers/node && RUST_LOG=vcx=trace npm run test
test-integration-node-wrapper:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-22.04
strategy:
matrix:
node-version: [18.x]
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Setup NodeJS libvcx testing environment"
uses: ./.github/actions/setup-testing-nodejs
with:
node-version: ${{ matrix.node-version }}
- name: "Install vcxagent-core dependencies"
run: (cd agents/node/vcxagent-core && npm install)
- name: "Run demo"
run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo)
- name: "Run demo with revocation"
run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run demo:revocation)
- name: "Run integration tests"
run: (cd agents/node/vcxagent-core && AGENCY_URL=http://localhost:8080 npm run test:integration)
# Issue addressing the jobs below being commented out: https://github.com/hyperledger/aries-vcx/issues/916
# test-android-build:
# runs-on: ubuntu-20.04
# needs: [ workflow-setup, build-docker-android ]
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }}
# env:
# DOCKER_IMG_CACHED_ANDROID: ${{needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID}}
# steps:
# - name: "Git checkout"
# uses: actions/checkout@v3
# - name: "Docker Login"
# uses: azure/docker-login@v1
# with:
# login-server: ${{ env.URL_DOCKER_REGISTRY }}
# username: $GITHUB_ACTOR
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: "Load android image"
# uses: ./.github/actions/load-image
# with:
# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }}
# - name: "Run android tests"
# run: |
# rm -rf /tmp/imgcache
# docker run --rm -i $DOCKER_IMG_CACHED_ANDROID \
# sh -c '(cd $HOME/aries-vcx && ./wrappers/java/ci/android.test.sh armv7)'
# build-and-publish-ios-wrapper:
# needs: workflow-setup
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_IOS != 'true' }}
# runs-on: macos-11
# env:
# LIBVCX_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
# PUBLISH_VERSION: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
# steps:
# - name: "Git checkout"
# uses: actions/checkout@v2
# - name: Switch to xcode version 12.4
# run: |
# sudo xcode-select --switch /Applications/Xcode_12.4.app/Contents/Developer
# xcodebuild -version
# - name: "Build iOS wrapper"
# run: |
# ./wrappers/ios/ci/build.sh
# - uses: actions/upload-artifact@v3
# with:
# name: libvcx-ios-${{ env.PUBLISH_VERSION }}-device
# path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-device.zip
# - uses: actions/upload-artifact@v3
# with:
# name: libvcx-ios-${{ env.PUBLISH_VERSION }}-universal
# path: /tmp/artifacts/libvcx-ios-${{ env.PUBLISH_VERSION }}-universal.zip
# build-and-publish-android-device:
# runs-on: ubuntu-20.04
# needs: [ workflow-setup, build-docker-android ]
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }}
# env:
# FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-device
# DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}
# steps:
# - name: "Git checkout"
# uses: actions/checkout@v3
# - name: "Docker Login"
# uses: azure/docker-login@v1
# with:
# login-server: ${{ env.URL_DOCKER_REGISTRY }}
# username: $GITHUB_ACTOR
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: "Load android image"
# uses: ./.github/actions/load-image
# with:
# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }}
# - name: "Build, run android wrapper tests, and publish artifacts"
# uses: ./.github/actions/publish-android
# with:
# abis: "arm arm64"
# docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}
# full-version-name: ${{ env.FULL_VERSION_NAME }}
# - name: "Publish aar artifact"
# uses: actions/upload-artifact@v3
# with:
# name: ${{ env.FULL_VERSION_NAME }}
# path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar
#
# build-and-publish-android-emulator:
# runs-on: ubuntu-20.04
# needs: [ workflow-setup, build-docker-android ]
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.SKIP_ANDROID != 'true' }}
# env:
# FULL_VERSION_NAME: libvcx-android-${{needs.workflow-setup.outputs.PUBLISH_VERSION}}-emulator
# DOCKER_IMG_CACHED_ANDROID: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}
# steps:
# - name: "Git checkout"
# uses: actions/checkout@v3
# - name: "Docker Login"
# uses: azure/docker-login@v1
# with:
# login-server: ${{ env.URL_DOCKER_REGISTRY }}
# username: $GITHUB_ACTOR
# password: ${{ secrets.GITHUB_TOKEN }}
# - name: "Load android image"
# uses: ./.github/actions/load-image
# with:
# docker-img: ${{ env.DOCKER_IMG_CACHED_ANDROID }}
# - name: "Build, run android wrapper tests, and publish artifacts"
# uses: ./.github/actions/publish-android
# with:
# abis: "x86 x86_64"
# docker-img-name: ${{ needs.workflow-setup.outputs.DOCKER_IMG_CACHED_ANDROID }}
# full-version-name: ${{ env.FULL_VERSION_NAME }}
# - uses: actions/upload-artifact@v3
# with:
# name: ${{ env.FULL_VERSION_NAME }}
# path: /tmp/artifacts/aar/${{ env.FULL_VERSION_NAME }}.aar
build-and-publish-ubuntu-lib:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: ubuntu-20.04
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
- uses: Swatinem/rust-cache@v2
with:
key: "11"
- name: "Install dependencies"
shell: bash
run: |
sudo apt-get update -y
sudo apt-get install -y libsodium-dev libssl-dev libzmq3-dev
- name: "Build libvcx.so"
run: cargo build --release
- name: "Publish artifact libvcx.so"
uses: actions/upload-artifact@v3
with:
name: libvcx.so
path: target/release/libvcx.so
build-and-publish-darwin-lib:
needs: workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
runs-on: macos-11
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- uses: actions-rs/toolchain@v1
with:
toolchain: 1.65.0
- uses: Swatinem/rust-cache@v2
with:
key: "11"
- name: "Install dependencies"
shell: bash
run: |
brew install openssl
brew install zeromq
brew install libsodium
brew install pkg-config
- name: "Build libvcx.dylib"
run: cargo build --release
- name: "Publish artifact libvcx.dylib"
uses: actions/upload-artifact@v3
with:
name: libvcx.dylib
path: target/release/libvcx.dylib
##########################################################################################
############################ NPMJS PUBLISHING #######################################
publish-node-wrapper:
runs-on: ubuntu-20.04
needs:
- workflow-setup
- test-unit-workspace
- test-integration-libvcx
- test-integration-aries-vcx
- test-integration-aries-vcx-mysql
- test-node-wrapper
- test-integration-node-wrapper
- publish-napi
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Use Node.js 18"
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: "Publish package"
run: |
if [[ "$PUBLISH_VERSION" ]]
then
NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./wrappers/node/publish.sh
else
echo "New version was not defined, skipping release."
fi
publish-agent-core:
runs-on: ubuntu-20.04
needs:
- workflow-setup
- test-unit-workspace
- test-integration-libvcx
- test-integration-aries-vcx
- test-integration-aries-vcx-mysql
- test-node-wrapper
- test-integration-node-wrapper
- publish-napi
- publish-node-wrapper
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
env:
NPMJS_TOKEN: ${{ secrets.NPMJS_TOKEN }}
PUBLISH_VERSION: ${{needs.workflow-setup.outputs.PUBLISH_VERSION}}
steps:
- name: "Git checkout"
uses: actions/checkout@v3
- name: "Use Node.js 18"
uses: actions/setup-node@v3
with:
node-version: ${{ env.NODE_VERSION }}
- name: "Release agent-core package"
run: |
if [[ "$PUBLISH_VERSION" ]]
then
NPMJS_TOKEN=${{ secrets.NPMJS_TOKEN }} PUBLISH_VERSION=${{ env.PUBLISH_VERSION }} ./agents/node/vcxagent-core/publish.sh
else
echo "New version was not defined, skipping release."
fi
build-napi:
needs:
- workflow-setup
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
strategy:
fail-fast: false
matrix:
settings:
- host: ubuntu-20.04
target: x86_64-unknown-linux-gnu
build: |-
set -e
sudo apt-get update -y
sudo apt-get install -y libssl-dev libzmq3-dev
npm run build:napi
strip *.node
- host: ubuntu-20.04
target: x86_64-unknown-linux-musl
docker: ghcr.io/hyperledger/aries-vcx/napi-rs-alpine
build: |-
set -e
env
unset CC
unset CXX
cd wrappers/vcx-napi-rs
npm run build:napi
strip *.node
- host: macos-latest
target: x86_64-apple-darwin
build: |
brew install openssl zmq pkg-config
npm run build:napi
strip -x *.node
- host: macos-latest
target: aarch64-apple-darwin
skip: ${{ needs.workflow-setup.outputs.SKIP_NAPI_M1 }}
build: |
wget https://github.com/macports/macports-base/releases/download/v2.8.0/MacPorts-2.8.0-12-Monterey.pkg
sudo installer -pkg ./MacPorts-2.8.0-12-Monterey.pkg -target /
export PATH=/opt/local/bin:/opt/local/sbin:$PATH
sudo port install openssl +universal zmq +universal
export OPENSSL_DIR=/opt/local
export OPENSSL_INCLUDE_DIR=/opt/local/include/
export OPENSSL_LIB_DIR=/opt/local/lib/
export SODIUM_LIB_DIR=/opt/local/lib/
export SODIUM_INCLUDE_DIR=/opt/local/include
export LIBZMQ_LIB_DIR=/opt/local/lib/
export LIBZMQ_INCLUDE_DIR=/opt/local/include
export PKG_CONFIG_ALLOW_CROSS=1
export PKG_CONFIG_SYSROOT_DIR=/
export RUST_BACKTRACE=1
npm run build:napi -- --target aarch64-apple-darwin
strip -x *.node
name: ${{ matrix.settings.target }}
runs-on: ${{ matrix.settings.host }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/build-napi
if: ${{ matrix.settings.skip != 'true' }}
with:
docker: ${{ matrix.settings.docker }}
target: ${{ matrix.settings.target }}
build: ${{ matrix.settings.build }}
node-version: ${{ env.NODE_VERSION }}
rust-version: ${{ env.RUST_TOOLCHAIN_VERSON }}
publish-napi:
runs-on: ubuntu-20.04
needs:
- workflow-setup
- build-napi
if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' && needs.workflow-setup.outputs.IS_FORK == 'false' }}
steps:
- uses: actions/checkout@v3
- uses: ./.github/actions/publish-napi
with:
publish-version: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
npmjs-token: ${{ secrets.NPMJS_TOKEN }}
node-version: ${{ env.NODE_VERSION }}
##########################################################################################
############################## RELEASE #########################################
make-release:
runs-on: ubuntu-20.04
needs:
- workflow-setup
# - build-and-publish-ios-wrapper
# - build-and-publish-android-device
# - build-and-publish-android-emulator
- test-unit-workspace
- test-integration-libvcx
- test-integration-aries-vcx
- test-integration-aries-vcx-mysql
# - test-android-build
- test-node-wrapper
- test-integration-node-wrapper
if: ${{ needs.workflow-setup.outputs.RELEASE == 'true' || needs.workflow-setup.outputs.PRERELEASE == 'true' }}
outputs:
RELEASE_UPLOAD_URL: ${{ steps.create-release.outputs.upload_url }}
steps:
- name: "Git checkout"
uses: actions/checkout@v2
- name: "Generate changelog"
uses: heinrichreimer/action-github-changelog-generator@v2.3
with:
token: ${{ secrets.GITHUB_TOKEN }}
futureRelease: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
releaseBranch: main
pullRequests: true
unreleased: false
unreleasedOnly: false
issuesWoLabels: true
prWoLabels: true
stripGeneratorNotice: true
stripHeaders: false
maxIssues: 50
excludeLabels: duplicate,question,invalid,wontfix,changelog-excluded
breakingLabels: backwards-incompatible,breaking
deprecatedLabels: deprecated
headerLabel: "# Changelog"
breakingLabel: '### Breaking changes'
enhancementLabel: '### Enhancements'
bugsLabel: '### Bug fixes'
deprecatedLabel: '### Deprecations'
removedLabel: '### Removals'
securityLabel: '### Security fixes'
issuesLabel: '### Other issues'
prLabel: '### Other pull requests'
addSections: '{"ci":{"prefix":"### CI changes","labels":["ci"]},"wrappers":{"prefix":"### Wrapper changes","labels":["wrappers"]},"agents":{"prefix":"### Changes to agents","labels":["agents"]},"features":{"prefix":"### Features","labels":["features"]},"hotfix":{"prefix":"### Hotfixes","labels":["hotfix"]},"security":{"prefix":"### Security fixes","labels":["security"]},"refactoring":{"prefix":"### Refactoring","labels":["refactoring"]},"tests":{"prefix":"### Tests","labels":["tests"]},"update":{"prefix":"### Updates","labels":["update"]}}'
excludeTagsRegex: '^((([0-9]+)\.([0-9]+)\.([0-9]+)(?:-([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))+)?)$'
- name: "Create a new release"
id: create-release
uses: actions/create-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
tag_name: ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
release_name: Release ${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}
body_path: ./CHANGELOG.md
draft: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }}
prerelease: ${{ needs.workflow-setup.outputs.PRERELEASE == 'true' }}
# release-android-device:
# runs-on: ubuntu-20.04
# needs: [ workflow-setup, make-release ]
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
# steps:
# - name: "Fetch android device build from artifacts"
# uses: actions/download-artifact@v2
# with:
# name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device
# - name: "Upload release assets"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
# with:
# upload_url: ${{ needs.make-release.outputs.RELEASE_UPLOAD_URL }}
# asset_path: ./libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar
# asset_name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-device.aar
# asset_content_type: application/aar
#
# release-android-emulator:
# runs-on: ubuntu-20.04
# needs: [ workflow-setup, make-release ]
# if: ${{ needs.workflow-setup.outputs.SKIP_CI != 'true' }}
# steps:
# - name: "Fetch android emulator build from artifacts"
# uses: actions/download-artifact@v2
# with:
# name: libvcx-android-${{ needs.workflow-setup.outputs.PUBLISH_VERSION }}-emulator
# - name: "Upload release assets"
# uses: actions/upload-release-asset@v1
# env:
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}