forked from hyperledger-cacti/cacti
-
Notifications
You must be signed in to change notification settings - Fork 0
217 lines (179 loc) · 7.44 KB
/
test_weaver-docker-build.yaml
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
# Copyright IBM Corp. All Rights Reserved.
#
# SPDX-License-Identifier: CC-BY-4.0
name: Test All Docker Images Build
env:
NODEJS_VERSION: v18.18.2
on:
push:
branches: [ main ]
pull_request:
branches: [ main ]
concurrency:
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
cancel-in-progress: true
jobs:
check_code_changed:
outputs:
relay_changed: ${{ steps.changes.outputs.relay_changed }}
fabric_driver_changed: ${{ steps.changes.outputs.fabric_driver_changed }}
corda_driver_changed: ${{ steps.changes.outputs.corda_driver_changed }}
iin_agent_changed: ${{ steps.changes.outputs.iin_agent_changed }}
runs-on: ubuntu-22.04
steps:
- uses: actions/[email protected]
- uses: dorny/[email protected]
id: changes
with:
filters: |
relay_changed:
- './weaver/common/protos-rs/**'
- './weaver/core/relay/**'
- '.github/workflows/test_weaver-docker-build.yaml'
fabric_driver_changed:
- './weaver/common/protos/**'
- './weaver/common/protos-js/**'
- './weaver/sdks/fabric/interoperation-node-sdk/**'
- './weaver/core/drivers/fabric-driver/**'
- '.github/workflows/test_weaver-docker-build.yaml'
corda_driver_changed:
- './weaver/common/protos/**'
- './weaver/common/protos-java-kt/**'
- './weaver/core/network/corda-interop-app/**'
- './weaver/sdks/corda/**'
- './weaver/core/drivers/corda-driver/**'
- '.github/workflows/test_weaver-docker-build.yaml'
iin_agent_changed:
- './weaver/common/protos/**'
- './weaver/common/protos-js/**'
- './weaver/sdks/fabric/interoperation-node-sdk/**'
- './weaver/core/identity-management/iin-agent/**'
- '.github/workflows/test_weaver-docker-build.yaml'
build_docker_relay:
needs: check_code_changed
if: needs.check_code_changed.outputs.relay_changed == 'true'
# if: ${{ false }}
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Build Image
run: make build-server-local
working-directory: weaver/core/relay
build_docker_fabric_driver_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.fabric_driver_changed == 'true'
# if: ${{ false }}
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Use Node.js ${{ env.NODEJS_VERSION }}
uses: actions/[email protected]
with:
node-version: ${{ env.NODEJS_VERSION }}
- name: Use Protoc 3.15
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- name: Build JS Protos (Local)
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-js
- name: Build Fabric Interop Node SDK (Local)
run: make build-local
working-directory: weaver/sdks/fabric/interoperation-node-sdk
- name: Build Image (Local)
run: make build-image-local
working-directory: weaver/core/drivers/fabric-driver
build_docker_fabric_driver_packages:
needs: check_code_changed
if: ${{ false && needs.check_code_changed.outputs.fabric_driver_changed == 'true' }}
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Setup .npmrc
run: |
cp .npmrc.template .npmrc
sed -i "s/<personal-access-token>/${{ secrets.GITHUB_TOKEN }}/g" .npmrc
cat .npmrc
working-directory: weaver/core/drivers/fabric-driver
- name: Build Image
run: make build-image
working-directory: weaver/core/drivers/fabric-driver
build_docker_corda_driver_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.corda_driver_changed == 'true'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Set up JDK 8
uses: actions/[email protected]
with:
java-version: '8'
distribution: 'adopt'
- name: Build Protos (Local)
run: make build
working-directory: weaver/common/protos-java-kt
- name: Build Corda Interop App (Local)
run: make build-local
working-directory: weaver/core/network/corda-interop-app
- name: Build Corda Interop SDK (Local)
run: make build
working-directory: weaver/sdks/corda
- name: Build Image (Local)
run: make image-local
working-directory: weaver/core/drivers/corda-driver
build_docker_corda_driver_packages:
needs: check_code_changed
if: ${{ false && needs.check_code_changed.outputs.corda_driver_changed == 'true' }}
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Generate github.properties
run: |
echo "Using ${GITHUB_ACTOR} user."
echo "username=${GITHUB_ACTOR}" >> github.properties
echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.properties
echo "url=https://maven.pkg.github.com/${GITHUB_ACTOR}/cacti" >> github.properties
echo "Using ${GITHUB_ACTOR} user."
echo "username=${GITHUB_ACTOR}" >> github.main.properties
echo "password=${{ secrets.GITHUB_TOKEN }}" >> github.main.properties
echo "url=https://maven.pkg.github.com/hyperledger/cacti" >> github.main.properties
make build || mv github.main.properties github.properties
make clean
cat github.properties
working-directory: weaver/core/drivers/corda-driver
- name: Build Image
run: make image
working-directory: weaver/core/drivers/corda-driver
build_docker_iin_agent_local:
needs: check_code_changed
if: needs.check_code_changed.outputs.iin_agent_changed == 'true'
runs-on: ubuntu-22.04
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/[email protected]
- name: Use Node.js ${{ env.NODEJS_VERSION }}
uses: actions/[email protected]
with:
node-version: ${{ env.NODEJS_VERSION }}
- name: Use Protoc 3.15
run: |
curl -LO https://github.com/protocolbuffers/protobuf/releases/download/v3.15.6/protoc-3.15.6-linux-x86_64.zip
unzip protoc-3.15.6-linux-x86_64.zip -d protoc
- name: Build JS Protos (Local)
run: |
export PATH="$PATH:${GITHUB_WORKSPACE}/protoc/bin"
make build
working-directory: weaver/common/protos-js
- name: Build Fabric Interop Node SDK (Local)
run: make build-local
working-directory: weaver/sdks/fabric/interoperation-node-sdk
- name: Build Image
run: make build-image-local
working-directory: weaver/core/identity-management/iin-agent