-
Notifications
You must be signed in to change notification settings - Fork 5
272 lines (256 loc) · 8.19 KB
/
ci-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
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
name: Compilation & tests
on:
workflow_dispatch:
push:
branches:
- main
- develop
pull_request:
branches:
- main
- develop
jobs:
job_build_debug:
name: Build debug
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build plugin
run: |
make DEBUG=1
- name: Upload binary
uses: actions/upload-artifact@v2
with:
name: app-debug
path: bin
job_scan_build:
name: Clang Static Analyzer
needs: job_build_debug
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- uses: actions/checkout@v2
- name: Build with Clang Static Analyzer
run: |
git config --global --add safe.directory /__w/LedgerHQ-app-plugin-poap/LedgerHQ-app-plugin-poap
git config --global --add safe.directory /__w/app-plugin-poap/app-plugin-poap
make clean
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
- uses: actions/upload-artifact@v2
if: failure()
with:
name: scan-build
path: scan-build
job_coverity_scan:
name: Coverity Scan
needs: job_build_debug
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-scanner:latest
steps:
- uses: actions/checkout@v2
- name: Build with cov-build
run: |
make clean
cov-build --dir cov-int make default
- name: Submit the result to Coverity Scan
run: |
tar czvf cov-int.tar.gz cov-int
curl \
--form token=$TOKEN \
--form email=$EMAIL \
--form [email protected] \
--form version=master \
--form description="POAP Plugin" \
https://scan.coverity.com/builds?project=LedgerHQ%2Fapp-plugin-poap
env:
EMAIL: ${{ secrets.COVERITY_SCAN_EMAIL }}
TOKEN: ${{ secrets.COVERITY_SCAN_TOKEN }}
job_build_debug_nano_s:
name: Build debug Nano S
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build plugin for Nano S
run: |
make clean
make BOLOS_SDK=$NANOS_SDK
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/poap_nanos.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/poap_nanos.elf
job_build_debug_nano_x:
name: Build debug Nano X
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build plugin for Nano X
run: |
make clean
make BOLOS_SDK=$NANOX_SDK
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/poap_nanox.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/poap_nanox.elf
job_build_debug_nano_sp:
name: Build debug Nano S+
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Clone
uses: actions/checkout@v2
with:
submodules: recursive
- name: Build plugin for Nano S+
run: |
make clean
make BOLOS_SDK=$NANOSP_SDK
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/poap_nanosp.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/poap_nanosp.elf
job_build_ethereum_nano_s:
name: Build Ethereum application for Nano S testing
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Checkout app-ethereum
uses: actions/checkout@v2
with:
repository: LedgerHQ/app-ethereum
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
submodules: recursive
- name: Build ethereum
run: |
make clean
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOS_SDK CHAIN=ethereum ALLOW_DATA=1
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/ethereum_nanos.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/ethereum_nanos.elf
job_build_ethereum_nano_x:
name: Build Ethereum application for Nano X testing
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Checkout app-ethereum
uses: actions/checkout@v2
with:
repository: LedgerHQ/app-ethereum
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
submodules: recursive
- name: Build ethereum
run: |
make clean
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOX_SDK CHAIN=ethereum ALLOW_DATA=1
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/ethereum_nanox.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/ethereum_nanox.elf
job_build_ethereum_nano_sp:
name: Build Ethereum application for Nano S+ testing
runs-on: ubuntu-latest
container:
image: ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
steps:
- name: Checkout app-ethereum
uses: actions/checkout@v2
with:
repository: LedgerHQ/app-ethereum
ref: ${{ ((github.base_ref || github.ref_name) == 'main' && 'master') || (github.base_ref || github.ref_name) }}
submodules: recursive
- name: Build ethereum
run: |
make clean
make -j DEBUG=1 BYPASS_SIGNATURES=1 BOLOS_SDK=$NANOSP_SDK CHAIN=ethereum ALLOW_DATA=1
- name: Move binary to test directory
run: |
mkdir -p ./tests/elfs/
mv bin/app.elf ./tests/elfs/ethereum_nanosp.elf
- name: Upload plugin binary
uses: actions/upload-artifact@v2
with:
name: binaries
path: tests/elfs/ethereum_nanosp.elf
jobs-e2e-tests:
needs:
- job_build_debug_nano_s
- job_build_debug_nano_x
- job_build_debug_nano_sp
- job_build_ethereum_nano_s
- job_build_ethereum_nano_x
- job_build_ethereum_nano_sp
runs-on: ubuntu-latest
steps:
- name: Test
run: |
id
echo $HOME
echo $DISPLAY
- name: Checkout
uses: actions/checkout@v2
- name: Download built binaries
uses: actions/download-artifact@v2
with:
name: binaries
path: tests/elfs/
- name: Check downloaded binaries
run: ls -lh ./tests/elfs
- run: sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
- name: Install node
uses: actions/setup-node@v2
with:
node-version: "16.4.0"
- name: Install yarn
run: |
npm install -g yarn
- name: Build/Install build js deps
run: |
cd tests && yarn install
- name: Run zemu tests
run: |
cd tests && yarn test