-
Notifications
You must be signed in to change notification settings - Fork 11
190 lines (186 loc) · 7.27 KB
/
workflow.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
name: WeDPR-Lab-Crypto GitHub Actions
on:
push:
paths-ignore:
- "docs/**"
- "Changelog.md"
- "README.md"
pull_request:
paths-ignore:
- "docs/**"
- "Changelog.md"
- "README.md"
release:
types: [published, created, edited]
env:
CCACHE_DIR: ${{ github.workspace }}/ccache
jobs:
build_with_macos:
name: build_with_macos
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [macos-latest]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: Nightly default
run: rustup default nightly
- name: install macOS dependencies
if: runner.os == 'macOS'
run: brew install ccache
- name: build
run: cargo build --all --all-targets --verbose --release
- name: run test
run: cargo test
- name: bench
run: cargo bench
- uses: actions/upload-artifact@v2
with:
name: libffi_c_crypto.dylib
path: target/release/libffi_c_crypto.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_c_zkp.dylib
path: target/release/libffi_c_zkp.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_java_crypto_binary.dylib
path: target/release/libffi_java_crypto_binary.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_c_crypto_binary.dylib
path: target/release/libffi_c_crypto_binary.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_fisco_bcos_sdk.dylib
path: target/release/libffi_fisco_bcos_sdk.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_c_fisco_bcos.dylib
path: target/release/libffi_c_fisco_bcos.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_java_crypto.dylib
path: target/release/libffi_java_crypto.dylib
- name: build ffi_java_sdk
run: cargo clean && cd ffi/ffi_java/ffi_java_crypto && cargo build --release --no-default-features --features "wedpr_f_hex wedpr_f_signature_secp256k1 wedpr_f_hash_keccak256 wedpr_f_signature_sm2 wedpr_f_hash_sm3 wedpr_f_vrf_curve25519"
- name: rename to ffi_java_sdk lib
run: mv target/release/libffi_java_crypto.dylib target/release/libffi_java_sdk.dylib
- uses: actions/upload-artifact@v2
with:
name: libffi_java_sdk.dylib
path: target/release/libffi_java_sdk.dylib
build_with_centos:
name: build_with_centos
runs-on: ubuntu-latest
container:
image: docker.io/centos:7
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- name: install rust language
uses: actions-rs/toolchain@v1
with:
toolchain: nightly-2022-07-28
override: true
- name: install CentOS dependencies
run: |
yum install -y epel-release centos-release-scl
yum install -y java-11-openjdk-devel git make gcc gcc-c++ glibc-static glibc-devel openssl openssl-devel cmake3 ccache devtoolset-7 libzstd-devel zlib-devel flex bison python-devel python3-devel && source /opt/rh/devtoolset-7/enable
- name: configure and compile
run: |
cargo build --all --all-targets --verbose --release
cargo test
cargo bench
- uses: actions/upload-artifact@v2
with:
name: libffi_c_crypto.so
path: target/release/libffi_c_crypto.so
- uses: actions/upload-artifact@v2
with:
name: libffi_c_zkp.so
path: target/release/libffi_c_zkp.so
- uses: actions/upload-artifact@v2
with:
name: libffi_java_crypto_binary.so
path: target/release/libffi_java_crypto_binary.so
- uses: actions/upload-artifact@v2
with:
name: libffi_c_crypto_binary.so
path: target/release/libffi_c_crypto_binary.so
- uses: actions/upload-artifact@v2
with:
name: libffi_fisco_bcos_sdk.so
path: target/release/libffi_fisco_bcos_sdk.so
- uses: actions/upload-artifact@v2
with:
name: libffi_c_fisco_bcos.so
path: target/release/libffi_c_fisco_bcos.so
- uses: actions/upload-artifact@v2
with:
name: libffi_java_crypto.so
path: target/release/libffi_java_crypto.so
- name: build ffi_java_sdk
run: cargo clean && cd ffi/ffi_java/ffi_java_crypto && cargo build --release --no-default-features --features "wedpr_f_hex wedpr_f_signature_secp256k1 wedpr_f_hash_keccak256 wedpr_f_signature_sm2 wedpr_f_hash_sm3 wedpr_f_vrf_curve25519"
- name: rename to ffi_java_sdk lib
run: mv target/release/libffi_java_crypto.so target/release/libffi_java_sdk.so
- uses: actions/upload-artifact@v2
with:
name: libffi_java_sdk.so
path: target/release/libffi_java_sdk.so
build_with_windows:
name: build_with_windows
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [windows-2019]
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 5
- run: echo "VCPKG_ROOT=$env:VCPKG_INSTALLATION_ROOT" | Out-File -FilePath $env:GITHUB_ENV -Append
- run: vcpkg install openssl:x64-windows-static-md
- name: build and test
run: |
cargo build --all --all-targets --verbose --release
cargo test
cargo bench
- uses: actions/upload-artifact@v2
with:
name: ffi_c_crypto.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_c_crypto.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_c_zkp.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_c_zkp.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_java_crypto_binary.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_java_crypto_binary.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_c_crypto_binary.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_c_crypto_binary.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_fisco_bcos_sdk.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_fisco_bcos_sdk.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_c_fisco_bcos.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_c_fisco_bcos.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_java_crypto.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_java_crypto.dll
- name: build ffi_java_sdk
run: cargo clean && cd ffi/ffi_java/ffi_java_crypto && cargo build --release --no-default-features --features "wedpr_f_hex wedpr_f_signature_secp256k1 wedpr_f_hash_keccak256 wedpr_f_signature_sm2 wedpr_f_hash_sm3 wedpr_f_vrf_curve25519"
- name: rename to vrf lib
run: mv D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_java_crypto.dll D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_java_sdk.dll
- uses: actions/upload-artifact@v2
with:
name: ffi_java_sdk.dll
path: D:\a\WeDPR-Lab-Crypto\WeDPR-Lab-Crypto\target\release\ffi_java_sdk.dll