forked from hyperledger/indy-vdr
-
Notifications
You must be signed in to change notification settings - Fork 1
301 lines (249 loc) · 7.71 KB
/
build.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
name: "Indy-VDR"
on:
push:
branches: [main]
pull_request:
branches: [main]
release:
types: [created]
workflow_dispatch:
inputs:
publish:
description: "Publish packages"
required: true
default: "false"
jobs:
check:
name: Run Checks
strategy:
matrix:
os: [macos-11, windows-latest, ubuntu-latest]
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache cargo resources
uses: Swatinem/rust-cache@v1
- name: Cargo check
uses: actions-rs/cargo@v1
with:
command: check
- name: Cargo fmt
uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
- name: Debug build
uses: actions-rs/cargo@v1
with:
command: build
args: --manifest-path libindy_vdr/Cargo.toml --features zmq_vendored
test-suite:
name: Run Test Suite
needs: [check]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache cargo resources
uses: Swatinem/rust-cache@v1
- name: Run node pool
run: |
docker build -f ci/indy-pool.dockerfile -t test_pool --build-arg pool_ip=10.0.0.2 ci
docker network create --subnet=10.0.0.0/8 indy-sdk-network
docker run -d --name indy_pool -p 9701-9708:9701-9708 --net=indy-sdk-network test_pool
- name: Run tests
uses: actions-rs/cargo@v1
with:
command: test
args: --manifest-path libindy_vdr/Cargo.toml --features local_nodes_pool
build-manylinux:
name: Build Library (Manylinux)
needs: [check]
strategy:
matrix:
include:
- os: ubuntu-latest
lib: libindy_vdr.so
container: andrewwhitehead/manylinux2014-base
container: ${{ matrix.container }}
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
- name: Cache cargo resources
uses: Swatinem/rust-cache@v1
- name: Build library
env:
BUILD_TARGET: ${{ matrix.target }}
BUILD_FEATURES: zmq_vendored
run: sh ./build.sh
- name: Upload library artifacts
uses: actions/upload-artifact@v2
with:
name: library-${{ runner.os }}
path: target/release/${{ matrix.lib }}
build-release:
name: Build Library (MacOS/Win)
needs: [check]
strategy:
matrix:
include:
- os: macos-11
lib: libindy_vdr.dylib
target: apple-darwin
toolchain: beta # beta required for aarch64-apple-darwin target
- os: windows-latest
lib: indy_vdr.dll
toolchain: stable
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install Rust toolchain
uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: ${{ matrix.toolchain }}
- name: Cache cargo resources
uses: Swatinem/rust-cache@v1
- name: Build library
env:
BUILD_TARGET: ${{ matrix.target }}
BUILD_TOOLCHAIN: ${{ matrix.toolchain }}
BUILD_FEATURES: zmq_vendored
run: sh ./build.sh
- name: Upload library artifacts
uses: actions/upload-artifact@v2
with:
name: library-${{ runner.os }}
path: target/release/${{ matrix.lib }}
build-golang:
name: Build and Test Go wrapper
needs: [build-manylinux]
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: "Use Golang 1.14.x+"
uses: actions/setup-go@v2
with:
go-version: "^1.14.0"
- name: Fetch library artifacts
uses: actions/download-artifact@v2
with:
name: library-${{ runner.os }}
- name: Build and test wrapper
run: |
sudo cp libindy_vdr.so /usr/lib/
cd wrappers/golang
go run cmd/demo/demo.go
# build-nodejs:
# name: Build and Test NodeJS wrapper
# needs: [build-manylinux]
# runs-on: ubuntu-latest
# steps:
# - name: Checkout
# uses: actions/checkout@v2
# - name: Use Node.js 12.x
# uses: actions/setup-node@v1
# with:
# node-version: 12.x
# - name: Fetch library artifacts
# uses: actions/download-artifact@v2
# with:
# name: library-${{ runner.os }}
# - name: Build and test wrapper
# run: |
# sudo cp libindy_vdr.so /usr/lib/
# cd wrappers/nodejs
# npm install
# npm run compile
# npm run test:unit
# - name: Run NodeJS integration tests against Sovrin Buildernet
# run: |
# INDY_NETWORK=SOVRIN_BUILDER_NET npm run test:integration
# working-directory: wrappers/nodejs
# - if: |
# (github.event_name == 'release' ||
# (github.event_name == 'workflow_dispatch' &&
# github.event.inputs.publish == 'true'))
# name: Publish npm package
# env:
# NODE_AUTH_TOKEN: ${{secrets.npm_token}}
# run: |
# npm ci
# npm publish
# working-directory: wrappers/nodejs
build-py:
name: Build and Test Python Wrapper
needs: [build-manylinux, build-release]
strategy:
matrix:
os: [ubuntu-latest, macos-11, windows-latest]
python-version: [3.6]
include:
- os: ubuntu-latest
plat-name: manylinux2014_x86_64
- os: macos-11
plat-name: macosx_10_9_universal2 # macosx_10_9_x86_64
- os: windows-latest
plat-name: win_amd64
runs-on: ${{ matrix.os }}
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install setuptools wheel twine auditwheel
- name: Fetch library artifacts
uses: actions/download-artifact@v2
with:
name: library-${{ runner.os }}
path: wrappers/python/indy_vdr/
- name: Build and test python package
shell: sh
run: |
python setup.py bdist_wheel --python-tag=py3 --plat-name=${{ matrix.plat-name }}
pip install dist/*
python -m demo.test
working-directory: wrappers/python
- if: "runner.os == 'Linux'"
name: Auditwheel
run: auditwheel show wrappers/python/dist/*
- name: Upload python package
uses: actions/upload-artifact@v2
with:
name: python-${{ runner.os }}
path: wrappers/python/dist/*
- if: |
(github.event_name == 'release' ||
(github.event_name == 'workflow_dispatch' &&
github.event.inputs.publish == 'true'))
name: Publish python package
env:
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }}
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }}
run: |
twine upload --skip-existing dist/*
working-directory: wrappers/python