1
+ name : Compilation & tests
2
+
3
+ on :
4
+ push :
5
+ branches :
6
+ - main
7
+ pull_request :
8
+ branches :
9
+ - main
10
+
11
+ jobs :
12
+ job_build_debug :
13
+ name : Build debug
14
+ runs-on : ubuntu-latest
15
+
16
+ container :
17
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
18
+
19
+ steps :
20
+ - name : Clone
21
+ uses : actions/checkout@v2
22
+ with :
23
+ submodules : recursive
24
+
25
+ - name : Build Ledger NFT plugin
26
+ run : |
27
+ make DEBUG=1
28
+
29
+ - name : Upload Ledger NFT binary
30
+ uses : actions/upload-artifact@v2
31
+ with :
32
+ name : ledger-nft-app-debug
33
+ path : bin
34
+
35
+ job_scan_build :
36
+ name : Clang Static Analyzer
37
+ needs : job_build_debug
38
+ runs-on : ubuntu-latest
39
+
40
+ container :
41
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
42
+
43
+ steps :
44
+ - uses : actions/checkout@v2
45
+
46
+ - name : Build with Clang Static Analyzer
47
+ run : |
48
+ make clean
49
+ scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
50
+ - uses : actions/upload-artifact@v2
51
+ if : failure()
52
+ with :
53
+ name : scan-build
54
+ path : scan-build
55
+
56
+ job_coverity_scan :
57
+ name : Coverity Scan
58
+ needs : job_build_debug
59
+ runs-on : ubuntu-latest
60
+
61
+ container :
62
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-scanner:latest
63
+
64
+ steps :
65
+ - uses : actions/checkout@v2
66
+
67
+ - name : Build with cov-build
68
+ run : |
69
+ make clean
70
+ cov-build --dir cov-int make default
71
+ - name : Submit the result to Coverity Scan
72
+ run : |
73
+ tar czvf cov-int.tar.gz cov-int
74
+ curl \
75
+ --form token=$TOKEN \
76
+ --form email=$EMAIL \
77
+
78
+ --form version=master \
79
+ --form description="Ledger NFT Plugin" \
80
+ https://scan.coverity.com/builds?project=LedgerHQ%2Fapp-plugin-ledgernft
81
+ env :
82
+ EMAIL : ${{ secrets.COVERITY_SCAN_EMAIL }}
83
+ TOKEN : ${{ secrets.COVERITY_SCAN_TOKEN }}
84
+ job_build_debug_nano_s :
85
+ name : Build debug Nano S
86
+ runs-on : ubuntu-latest
87
+ container :
88
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
89
+ steps :
90
+ - name : Clone
91
+ uses : actions/checkout@v2
92
+ with :
93
+ submodules : recursive
94
+ - name : Build plugin for Nano S
95
+ run : |
96
+ make clean
97
+ make BOLOS_SDK=$NANOS_SDK
98
+ - name : Move binary to test directory
99
+ run : |
100
+ mkdir -p ./tests/elfs/
101
+ mv bin/app.elf ./tests/elfs/ledger_nft_nanos.elf
102
+ - name : Upload plugin binary
103
+ uses : actions/upload-artifact@v2
104
+ with :
105
+ name : binaries
106
+ path : tests/elfs/ledger_nft_nanos.elf
107
+
108
+ job_build_debug_nano_sp :
109
+ name : Build debug Nano S+
110
+ runs-on : ubuntu-latest
111
+ container :
112
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
113
+ steps :
114
+ - name : Clone
115
+ uses : actions/checkout@v2
116
+ with :
117
+ submodules : recursive
118
+ - name : Build plugin for Nano S+
119
+ run : |
120
+ make clean
121
+ make BOLOS_SDK=$NANOSP_SDK
122
+ - name : Move binary to test directory
123
+ run : |
124
+ mkdir -p ./tests/elfs/
125
+ mv bin/app.elf ./tests/elfs/ledger_nft_nanosp.elf
126
+ - name : Upload plugin binary
127
+ uses : actions/upload-artifact@v2
128
+ with :
129
+ name : binaries
130
+ path : tests/elfs/ledger_nft_nanosp.elf
131
+
132
+ job_build_debug_nano_x :
133
+ name : Build debug Nano X
134
+ runs-on : ubuntu-latest
135
+ container :
136
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
137
+ steps :
138
+ - name : Clone
139
+ uses : actions/checkout@v2
140
+ with :
141
+ submodules : recursive
142
+ - name : Build plugin for Nano X
143
+ run : |
144
+ make clean
145
+ make BOLOS_SDK=$NANOX_SDK
146
+ - name : Move binary to test directory
147
+ run : |
148
+ mkdir -p ./tests/elfs/
149
+ mv bin/app.elf ./tests/elfs/ledger_nft_nanox.elf
150
+ - name : Upload plugin binary
151
+ uses : actions/upload-artifact@v2
152
+ with :
153
+ name : binaries
154
+ path : tests/elfs/ledger_nft_nanox.elf
155
+
156
+ job_build_ethereum_nano_s :
157
+ name : Build Ethereum application for Nano S testing
158
+ runs-on : ubuntu-latest
159
+ container :
160
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
161
+ steps :
162
+ - name : Checkout app-ethereum
163
+ uses : actions/checkout@v2
164
+ with :
165
+ repository : LedgerHQ/app-ethereum
166
+ ref : ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
167
+ submodules : recursive
168
+ - name : Build ethereum
169
+ run : |
170
+ make clean
171
+ make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOS_SDK CHAIN=ethereum ALLOW_DATA=1
172
+ - name : Move binary to test directory
173
+ run : |
174
+ mkdir -p ./tests/elfs/
175
+ mv bin/app.elf ./tests/elfs/ethereum_nanos.elf
176
+ - name : Upload plugin binary
177
+ uses : actions/upload-artifact@v2
178
+ with :
179
+ name : binaries
180
+ path : tests/elfs/ethereum_nanos.elf
181
+
182
+ job_build_ethereum_nano_sp :
183
+ name : Build Ethereum application for Nano S+ testing
184
+ runs-on : ubuntu-latest
185
+ container :
186
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
187
+ steps :
188
+ - name : Checkout app-ethereum
189
+ uses : actions/checkout@v2
190
+ with :
191
+ repository : LedgerHQ/app-ethereum
192
+ ref : ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
193
+ submodules : recursive
194
+ - name : Build ethereum
195
+ run : |
196
+ make clean
197
+ make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOSP_SDK CHAIN=ethereum ALLOW_DATA=1
198
+ - name : Move binary to test directory
199
+ run : |
200
+ mkdir -p ./tests/elfs/
201
+ mv bin/app.elf ./tests/elfs/ethereum_nanosp.elf
202
+ - name : Upload plugin binary
203
+ uses : actions/upload-artifact@v2
204
+ with :
205
+ name : binaries
206
+ path : tests/elfs/ethereum_nanosp.elf
207
+
208
+ job_build_ethereum_nano_x :
209
+ name : Build Ethereum application for Nano X testing
210
+ runs-on : ubuntu-latest
211
+ container :
212
+ image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
213
+ steps :
214
+ - name : Checkout app-ethereum
215
+ uses : actions/checkout@v2
216
+ with :
217
+ repository : LedgerHQ/app-ethereum
218
+ ref : ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
219
+ submodules : recursive
220
+ - name : Build ethereum
221
+ run : |
222
+ make clean
223
+ make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOX_SDK CHAIN=ethereum ALLOW_DATA=1
224
+ - name : Move binary to test directory
225
+ run : |
226
+ mkdir -p ./tests/elfs/
227
+ mv bin/app.elf ./tests/elfs/ethereum_nanox.elf
228
+ - name : Upload plugin binary
229
+ uses : actions/upload-artifact@v2
230
+ with :
231
+ name : binaries
232
+ path : tests/elfs/ethereum_nanox.elf
233
+
234
+ jobs-e2e-tests :
235
+ needs :
236
+ - job_build_debug_nano_s
237
+ - job_build_debug_nano_sp
238
+ - job_build_debug_nano_x
239
+ - job_build_ethereum_nano_s
240
+ - job_build_ethereum_nano_sp
241
+ - job_build_ethereum_nano_x
242
+ runs-on : ubuntu-latest
243
+ steps :
244
+ - name : Test
245
+ run : |
246
+ id
247
+ echo $HOME
248
+ echo $DISPLAY
249
+ - name : Checkout
250
+ uses : actions/checkout@v2
251
+ - name : Download built binaries
252
+ uses : actions/download-artifact@v2
253
+ with :
254
+ name : binaries
255
+ path : tests/elfs/
256
+ - name : Check downloaded binaries
257
+ run : ls -lh ./tests/elfs
258
+ - run : sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
259
+ - name : Install node
260
+ uses : actions/setup-node@v2
261
+ with :
262
+ node-version : " 16.4.0"
263
+ - name : Install yarn
264
+ run : |
265
+ npm install -g yarn
266
+ - name : Build/Install build js deps
267
+ run : |
268
+ cd tests && yarn install
269
+ - name : Run zemu tests
270
+ run : |
271
+ cd tests && yarn test
0 commit comments