@@ -18,14 +18,14 @@ jobs:
18
18
image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
19
19
20
20
steps :
21
- - uses : actions/checkout@v2
21
+ - uses : actions/checkout@v3
22
22
23
23
- name : Build with Clang Static Analyzer
24
24
run : |
25
25
make clean
26
26
scan-build --use-cc=clang -analyze-headers -enable-checker security -enable-checker unix -enable-checker valist -o scan-build --status-bugs make default
27
27
28
- - uses : actions/upload-artifact@v2
28
+ - uses : actions/upload-artifact@v3
29
29
if : failure()
30
30
with :
31
31
name : scan-build
@@ -42,15 +42,15 @@ jobs:
42
42
image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
43
43
44
44
steps :
45
- - uses : actions/checkout@v2
45
+ - uses : actions/checkout@v3
46
46
47
47
- name : Build testing binaries
48
48
run : |
49
49
git config --global --add safe.directory "$GITHUB_WORKSPACE"
50
50
cd tests/zemu/ && ./build_local_test_elfs.sh
51
51
52
52
- name : Upload app binaries
53
- uses : actions/upload-artifact@v2
53
+ uses : actions/upload-artifact@v3
54
54
with :
55
55
name : e2e_zemu_elfs
56
56
path : ./tests/zemu/elfs/
@@ -68,14 +68,14 @@ jobs:
68
68
echo $DISPLAY
69
69
70
70
- name : Checkout
71
- uses : actions/checkout@v2
71
+ uses : actions/checkout@v3
72
72
73
73
- run : sudo apt-get update -y && sudo apt-get install -y libusb-1.0.0 libudev-dev
74
74
75
- - name : Install node
76
- uses : actions/setup-node@v2
75
+ - name : Install NodeJS
76
+ uses : actions/setup-node@v3
77
77
with :
78
- node-version : " 14.4.0 "
78
+ node-version : " 16 "
79
79
80
80
- name : Install yarn
81
81
run : npm install -g yarn
87
87
run : mkdir tests/zemu/elfs
88
88
89
89
- name : Download app binaries
90
- uses : actions/download-artifact@v2
90
+ uses : actions/download-artifact@v3
91
91
with :
92
92
path : tmp/
93
93
@@ -109,7 +109,7 @@ jobs:
109
109
image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
110
110
111
111
steps :
112
- - uses : actions/checkout@v2
112
+ - uses : actions/checkout@v3
113
113
114
114
- name : Build testing binaries
115
115
run : |
@@ -119,7 +119,7 @@ jobs:
119
119
make clean && make -j DEBUG=1 NFT_TESTING_KEY=1 BOLOS_SDK=$NANOSP_SDK && mv bin/app.elf tests/speculos/elfs/nanosp.elf
120
120
121
121
- name : Upload app binaries
122
- uses : actions/upload-artifact@v2
122
+ uses : actions/upload-artifact@v3
123
123
with :
124
124
name : e2e_speculos_elfs
125
125
path : ./tests/speculos/elfs
@@ -136,13 +136,13 @@ jobs:
136
136
137
137
steps :
138
138
- name : Clone
139
- uses : actions/checkout@v2
139
+ uses : actions/checkout@v3
140
140
141
141
- name : Create tmp folder for artifacts
142
142
run : mkdir tests/speculos/elfs
143
143
144
144
- name : Download app binaries
145
- uses : actions/download-artifact@v2
145
+ uses : actions/download-artifact@v3
146
146
with :
147
147
path : tmp/
148
148
@@ -166,113 +166,18 @@ jobs:
166
166
# =====================================================
167
167
168
168
build_ragger_elfs :
169
- name : Building binaries for Ragger tests
170
- runs-on : ubuntu-latest
171
- container :
172
- image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder-lite:latest
173
-
174
- steps :
175
- - name : Clone
176
- uses : actions/checkout@v2
177
-
178
- - name : Build test binaries
179
- run : |
180
- make -j BOLOS_SDK=$NANOS_SDK CAL_TESTING_KEY=1
181
- mv bin/app.elf app-nanos.elf
182
- make clean
183
- make -j BOLOS_SDK=$NANOX_SDK CAL_TESTING_KEY=1
184
- mv bin/app.elf app-nanox.elf
185
- make clean
186
- make -j BOLOS_SDK=$NANOSP_SDK CAL_TESTING_KEY=1
187
- mv bin/app.elf app-nanosp.elf
188
-
189
- - name : Upload app binaries
190
- uses : actions/upload-artifact@v2
191
- with :
192
- name : ragger_elfs
193
- path : ./app-*.elf
194
-
195
- create_ragger_env :
196
- name : Cache Ragger environment
197
- runs-on : ubuntu-latest
198
-
199
- steps :
200
- - name : Clone
201
- uses : actions/checkout@v2
202
-
203
- - name : APT update
204
- run : |
205
- sudo apt update
206
-
207
- - name : Create virtual env with dependencies
208
- run : |
209
- cd tests/ragger
210
- python3 -m venv ./venv
211
- . ./venv/bin/activate
212
- pip3 install --extra-index-url https://test.pypi.org/simple/ -r requirements.txt
213
- # Used for the cache key
214
- echo "py_deps=$(pip freeze | md5sum | cut -d' ' -f1)" >> $GITHUB_ENV
215
-
216
- - name : Download QEMU
217
- run : |
218
- sudo apt install --download-only -y qemu-user-static
219
- mkdir -p tests/ragger/packages
220
- cp /var/cache/apt/archives/*.deb tests/ragger/packages/
221
- # Used for the cache key
222
- echo "deb_deps=$(find /var/cache/apt/archives/ -maxdepth 0 -type f -name '*.deb' | md5sum | cut -d' ' -f 1)" >> $GITHUB_ENV
223
-
224
- - name : Set up cache
225
- uses : actions/cache@v3
226
- with :
227
- key : ${{ runner.os }}-raggenv-${{ env.py_deps }}-${{ env.deb_deps }}
228
- path : |
229
- tests/ragger/venv/
230
- tests/ragger/packages/
231
- outputs :
232
- py_deps : ${{ env.py_deps }}
233
- deb_deps : ${{ env.deb_deps }}
234
-
169
+ name : Build app for Ragger tests
170
+ uses : LedgerHQ/ledger-app-workflows/.github/workflows/reusable_build.yml@v1
171
+ with :
172
+ upload_app_binaries_artifact : " ragger_elfs"
173
+ flags : " DEBUG=1 CAL_CI_KEY=1 DOMAIN_NAME_TEST_KEY=1"
174
+ run_for_devices : ' ["nanos", "nanox", "nanosp"]'
235
175
236
176
jobs-ragger-tests :
237
- name : Ragger tests
238
- strategy :
239
- matrix :
240
- model : ["nanos", "nanox", "nanosp"]
241
- needs : [build_ragger_elfs, create_ragger_env]
242
- runs-on : ubuntu-latest
243
-
244
- steps :
245
- - name : Clone
246
- uses : actions/checkout@v2
247
-
248
- - name : Download previously built artifacts
249
- uses : actions/download-artifact@v2
250
- with :
251
- name : ragger_elfs
252
- path : tmp/
253
-
254
- - name : Put them where they belong
255
- run : |
256
- mkdir -p tests/ragger/elfs
257
- find tmp/ -type f -name '*.elf' -exec cp {} tests/ragger/elfs/ \;
258
-
259
- - name : Get cached environment
260
- uses : actions/cache@v3
261
- with :
262
- key : ${{ runner.os }}-raggenv-${{ needs.create_ragger_env.outputs.py_deps }}-${{ needs.create_ragger_env.outputs.deb_deps }}
263
- path : |
264
- tests/ragger/venv/
265
- tests/ragger/packages/
266
-
267
- - name : Install QEMU
268
- run : |
269
- sudo mv tests/ragger/packages/*.deb /var/cache/apt/archives/
270
- sudo apt install -y qemu-user-static
271
-
272
- - name : Run tests
273
- env :
274
- CAL_SIGNATURE_TEST_KEY : ${{ secrets.CAL_SIGNATURE_TEST_KEY }}
275
- run : |
276
- cd tests/ragger
277
- . ./venv/bin/activate
278
- pytest --path ./elfs --model ${{ matrix.model }} -s -v
177
+ name : Run Ragger tests
178
+ needs : build_ragger_elfs
179
+ uses : LedgerHQ/ledger-app-workflows/.github/workflows/reusable_ragger_tests.yml@v1
180
+ with :
181
+ download_app_binaries_artifact : " ragger_elfs"
182
+ test_dir : tests/ragger
183
+ run_for_devices : ' ["nanos", "nanox", "nanosp"]'
0 commit comments