Skip to content

Commit eb662c7

Browse files
authored
chore: update CI (#77)
* chore: update ci workflow
1 parent 074e465 commit eb662c7

File tree

7 files changed

+49
-32
lines changed

7 files changed

+49
-32
lines changed

.dev.Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ DOCKER_BUILDER_ARGS = --rm -ti -v "$(realpath .):/app"
1818

1919
SPECULOS_TAG=latest
2020
SPECULOS_IMAGE = ghcr.io/ledgerhq/speculos:$(BUILDER_TAG)
21-
SPECULOS_ARGS = --sdk 2.0 --display headless
21+
SPECULOS_ARGS = --display headless
2222
DOCKER_SPECULOS_ARGS = --rm -ti -v "$(realpath .):/app"
2323
# webhost
2424
DOCKER_SPECULOS_ARGS += -p 5000:5000

.github/workflows/ci-workflow.yml

Lines changed: 39 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,45 @@
1+
---
2+
13
name: Compilation & tests
24

35
on:
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

911
jobs:
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: |
@@ -89,7 +102,7 @@ jobs:
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
@@ -99,8 +112,7 @@ jobs:
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-

.github/workflows/codeql.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,9 @@ name: "CodeQL"
22

33
on:
44
push:
5-
branches: [ "master", "dev" ]
5+
branches: [ "master", "dev", "main", "develop" ]
66
pull_request:
7-
branches: [ "master", "dev" ]
7+
branches: [ "master", "dev", "main", "develop" ]
88
schedule:
99
- cron: '16 19 * * 3'
1010

.github/workflows/guidelines_enforcer.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ on:
1313
push:
1414
branches:
1515
- master
16+
- dev
1617
- main
1718
- develop
1819
pull_request:

.github/workflows/lint-workflow.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ jobs:
99

1010
steps:
1111
- name: Clone
12-
uses: actions/checkout@v2
12+
uses: actions/checkout@v4
1313

1414
- name: Lint
1515
uses: DoozyX/clang-format-lint-action@v0.11

ledger_app.toml

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,3 +2,7 @@
22
build_directory = "./"
33
sdk = "C"
44
devices = ["nanos", "nanox", "nanos+"]
5+
6+
[tests]
7+
unit_directory = "./unit-tests/"
8+
pytest_directory = "./tests/"

src/ui/menu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ void ui_menu_main() {
3030
ux_flow_init(0, ux_menu_main_flow, NULL);
3131
}
3232

33-
UX_STEP_NOCB(ux_menu_info_step, bn, {"Hathor App", "(c) 2021 Hathor Labs"});
33+
UX_STEP_NOCB(ux_menu_info_step, bn, {"Hathor App", "(c) 2024 Hathor Labs"});
3434
UX_STEP_CB(ux_menu_back_step, pb, ui_menu_main(), {&C_icon_back, "Back"});
3535

3636
// FLOW for the about submenu:

0 commit comments

Comments
 (0)