-
Notifications
You must be signed in to change notification settings - Fork 4
183 lines (170 loc) · 4.41 KB
/
ci.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
name: ci
on:
pull_request:
branches:
- main
- testnet
- zklink_nexus
- v*
- devnet
- apex-devnet
push:
branches:
- main
- testnet
- zklink_nexus
- v*
- devnet
- apex-devnet
jobs:
fmt:
name: cargo fmt
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
profile: minimal
toolchain: stable
components: rustfmt
override: true
- uses: actions-rs/cargo@v1
with:
command: fmt
args: --all -- --check
# sort the dependencies in Cargo.toml
cargo_sort:
name: cargo sort
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-sort
version: latest
- run: cargo sort -c
# check cargo.toml format
taplo_fmt:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: taplo-cli
version: latest
- run: taplo check
# check unused dependency
cargo_machete:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: cargo-machete
version: latest
- run: cargo-machete
clippy_check:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: rustup component add clippy
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features ffi -- -D warnings
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: --features web -- -D warnings
- uses: actions-rs/clippy-check@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
args: -- -D warnings
build:
name: cargo build
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/cargo@v1
with:
command: build
go_binding:
name: go binding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: uniffi-bindgen-go
git: https://github.com/NordSecurity/uniffi-bindgen-go
tag: "v0.2.1+v0.25.0"
cache-key: "[email protected]+v0.25.0"
- uses: actions/setup-go@v4
with:
go-version: 1.21
- run: make test_go
cpp_binding:
name: cpp binding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: baptiste0928/cargo-install@v2
with:
crate: uniffi-bindgen-cpp
git: https://github.com/NordSecurity/uniffi-bindgen-cpp
tag: "v0.6.0+v0.25.0"
cache-key: "[email protected]+v0.25.0"
- run: make build_cpp run_example_cpp
python_binding:
name: python binding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: make build_python
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- run: make copy_lib_to_py_example run_example_python
dart_binding:
name: dart binding
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- uses: subosito/flutter-action@v2
with:
channel: stable
- name: build
run: |
cd bindings/dart
cargo install '[email protected]'
flutter pub get
flutter_rust_bridge_codegen generate
cd rust
cargo build --release
cd ..
cp ../../target/release/*.so .
export LD_LIBRARY_PATH=./:$LD_LIBRARY_PATH
dart pub add --dev test
dart test/main.dart
build_wasm:
name: build wasm
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- run: curl https://rustwasm.github.io/wasm-pack/installer/init.sh -sSf | sh
- run: make build_wasm
test:
name: cargo test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions-rs/toolchain@v1
with:
toolchain: stable
- run: make test