1+ ---
2+
13name : Compilation & tests
24
35on :
46 push :
5- branches : [ "master", "dev" ]
7+ branches : ["master", "dev", "main", "develop" ]
68 pull_request :
7- branches : [ "master", "dev" ]
9+ branches : ["master", "dev", "main", "develop" ]
810
911jobs :
1012 job_build_debug :
1113 name : Build debug
14+ strategy :
15+ matrix :
16+ device : [nanos, nanox, nanosp]
1217 runs-on : ubuntu-latest
1318
1419 container :
1520 image : ghcr.io/ledgerhq/ledger-app-builder/ledger-app-builder:latest
1621
1722 steps :
1823 - name : Clone
19- uses : actions/checkout@v2
24+ uses : actions/checkout@v4
2025
2126 - name : Build
2227 run : |
23- make DEBUG=1
28+ echo "Building for ${{ matrix.device }}..." && \
29+ eval "BOLOS_SDK=\$$(echo ${{ matrix.device }} | tr [:lower:] [:upper:])_SDK" && \
30+ echo "BOLOS_SDK value will be ${BOLOS_SDK}" && \
31+ make BOLOS_SDK=${BOLOS_SDK} DEBUG=1
32+
33+ - name : Prepare upload
34+ run : |
35+ find build/ -mindepth 2 -maxdepth 2 -type d ! -name 'bin' -exec rm -r {} +
2436
2537 - name : Upload app binary
26- uses : actions/upload-artifact@v2
38+ uses : actions/upload-artifact@v4
2739 with :
28- name : hathor-app-debug
29- path : bin
40+ name : hathor-app-debug-${{ matrix.device }}
41+ path : build/
42+ if-no-files-found : error
3043
3144 job_unit_test :
3245 name : Unit test
@@ -38,26 +51,26 @@ jobs:
3851
3952 steps :
4053 - name : Clone
41- uses : actions/checkout@v2
54+ uses : actions/checkout@v4
4255
4356 - name : Build unit tests
44- run : |
57+ run :
4558 cd unit-tests/
4659 bash run_tests.sh
4760
48- - name : Generate code coverage
49- run : |
50- cd unit-tests/
51- bash gen_coverage.sh
52-
53- - uses : actions/upload-artifact@v2
54- with :
55- name : code-coverage
56- path : unit-tests/coverage
57-
5861 job_test :
5962 name : Test
6063 needs : job_build_debug
64+ strategy :
65+ matrix :
66+ device : [nanos, nanox, nanosp]
67+ include :
68+ - device : nanos
69+ build_dir : nanos
70+ - device : nanosp
71+ build_dir : nanos2
72+ - device : nanox
73+ build_dir : nanox
6174 runs-on : ubuntu-latest
6275
6376 container :
@@ -74,13 +87,13 @@ jobs:
7487
7588 steps :
7689 - name : Clone
77- uses : actions/checkout@v2
90+ uses : actions/checkout@v4
7891
7992 - name : Download app binary
80- uses : actions/download-artifact@v2
93+ uses : actions/download-artifact@v4
8194 with :
82- name : hathor-app-debug
83- path : bin
95+ name : hathor-app-debug-${{ matrix.device }}
96+ path : build
8497
8598 - name : Install Poetry
8699 run : |
89102
90103 - name : Run test
91104 run : |
92- nohup bash -c "python /speculos/speculos.py bin/app.elf --sdk 2.0 --display headless" > speculos.log 2<&1 &
105+ nohup bash -c "python /speculos/speculos.py build/${{ matrix.build_dir }}/ bin/app.elf --model ${{ matrix.device }} --display headless" > speculos.log 2<&1 &
93106 cd tests && make install && make test
94107
95108 - name : Show speculos log
99112
100113 - name : Upload Speculos log
101114 if : success() || failure()
102- uses : actions/upload-artifact@v2
115+ uses : actions/upload-artifact@v4
103116 with :
104- name : speculos-log
117+ name : ${{ matrix.device }}- speculos-log. log
105118 path : speculos.log
106-
0 commit comments