forked from hyperledger-labs/fabric-token-sdk
-
Notifications
You must be signed in to change notification settings - Fork 0
143 lines (122 loc) · 3.47 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
name: Tests
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
workflow_dispatch:
inputs:
fsc-version:
default: 'github.com/hyperledger-labs/fabric-smart-client@main'
required: true
description: 'FSC dependency'
env:
FTS_PATH: "${{ github.workspace }}/fabric-token-sdk"
GOFLAGS: -mod=mod
jobs:
checks:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ${{ env.FTS_PATH }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "${{ env.FTS_PATH }}/go.mod"
- name: Replace FSC dep
working-directory: ${{ env.FTS_PATH }}
run: |
if [ -n "${{ github.event.inputs.fsc-version }}" ]; then
echo "Replace FSC dependency"
go mod edit -replace=github.com/hyperledger-labs/fabric-smart-client=${{ github.event.inputs.fsc-version }}
go mod tidy || true
else
echo "Skipping FSC dependency replacement"
fi
- name: Set up tools
working-directory: ${{ env.FTS_PATH }}
run: make install-tools
- name: Run checks
working-directory: ${{ env.FTS_PATH }}
run: make checks
utest:
needs: checks
runs-on: ubuntu-latest
strategy:
matrix:
tests: [unit-tests, unit-tests-race]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ${{ env.FTS_PATH }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "${{ env.FTS_PATH }}/go.mod"
- name: Set up tools
working-directory: ${{ env.FTS_PATH }}
run: make install-tools
- name: Run ${{ matrix.tests }}
working-directory: ${{ env.FTS_PATH }}
run: make ${{ matrix.tests }}
itest:
needs: checks
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
tests: [
dlog-fabric-t1,
dlog-fabric-t1-extras,
dlog-fabric-t2,
dlog-fabric-t3,
dlog-fabric-t4,
fabtoken-dlog-fabric,
dloghsm-fabric-t1,
dloghsm-fabric-t2,
fabtoken-fabric,
dlog-orion,
fabtoken-orion,
nft-dlog,
nft-fabtoken,
nft-dlog-orion,
nft-fabtoken-orion,
dvp-fabtoken,
dvp-dlog,
interop-fabtoken-t1,
interop-fabtoken-t2,
interop-fabtoken-t3,
interop-fabtoken-t4,
interop-fabtoken-t5,
interop-fabtoken-t6,
interop-dlog-t1,
interop-dlog-t2,
interop-dlog-t3,
interop-dlog-t4,
interop-dlog-t5,
interop-dlog-t6,
]
steps:
- name: Checkout code
uses: actions/checkout@v3
with:
path: ${{ env.FTS_PATH }}
- name: Set up Go
uses: actions/setup-go@v3
with:
go-version-file: "${{ env.FTS_PATH }}/go.mod"
- name: Set up tools
working-directory: ${{ env.FTS_PATH }}
run: make install-tools
- name: Download fabric binaries
working-directory: ${{ env.FTS_PATH }}
run: make download-fabric
- name: Docker
working-directory: ${{ env.FTS_PATH }}
run: make docker-images
- name: Run ${{ matrix.tests }}
working-directory: ${{ env.FTS_PATH }}
run: make integration-tests-${{ matrix.tests }}