@@ -166,111 +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@v3
177
-
178
- - name : Build test binaries
179
- run : |
180
- make -j BOLOS_SDK=$NANOS_SDK CAL_CI_KEY=1
181
- mv bin/app.elf app-nanos.elf
182
- make clean
183
- make -j BOLOS_SDK=$NANOX_SDK CAL_CI_KEY=1
184
- mv bin/app.elf app-nanox.elf
185
- make clean
186
- make -j BOLOS_SDK=$NANOSP_SDK CAL_CI_KEY=1
187
- mv bin/app.elf app-nanosp.elf
188
-
189
- - name : Upload app binaries
190
- uses : actions/upload-artifact@v3
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@v3
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@v3
247
-
248
- - name : Download previously built artifacts
249
- uses : actions/download-artifact@v3
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
- run : |
274
- cd tests/ragger
275
- . ./venv/bin/activate
276
- pytest --path ./elfs --model ${{ matrix.model }} -s -v --tb=short
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