Skip to content

Commit dbf74c0

Browse files
authored
Setup rust ci linux (#287)
* Bump Version * add rust-src component linux
1 parent 6576ef8 commit dbf74c0

File tree

12 files changed

+43
-39
lines changed

12 files changed

+43
-39
lines changed

.github/workflows/main.yml

Lines changed: 42 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,18 @@ jobs:
2929
make deps
3030
- run: make cpp_test
3131

32+
setup_rust:
33+
runs-on: ubuntu-latest
34+
outputs:
35+
cargo_home: ${{ steps.set_paths.outputs.cargo_home }}
36+
rustup_home: ${{ steps.set_paths.outputs.rustup_home }}
37+
steps:
38+
- id: set_paths
39+
run: |
40+
echo "cargo_home=$GITHUB_WORKSPACE/app/rust/.cargo" >> $GITHUB_OUTPUT
41+
echo "rustup_home=$GITHUB_WORKSPACE/app/rust/.rustup" >> $GITHUB_OUTPUT
42+
43+
3244
build_ledger:
3345
needs: [configure, setup_rust]
3446
runs-on: ubuntu-latest
@@ -39,15 +51,15 @@ jobs:
3951
BOLOS_SDK: /opt/nanos-secure-sdk
4052
HOME: /root
4153
CARGO_HOME: ${{ needs.setup_rust.outputs.cargo_home }}
42-
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
54+
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
4355
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${{ needs.setup_rust.outputs.cargo_home }}/bin
4456
outputs:
4557
size: ${{steps.build.outputs.size}}
4658
steps:
4759
- name: Checkout
4860
uses: actions/checkout@v4
4961
with:
50-
submodules: recursive
62+
submodules: true
5163
- name: Setup Rust environment
5264
uses: actions-rs/toolchain@v1
5365
with:
@@ -63,6 +75,8 @@ jobs:
6375
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
6476
restore-keys: |
6577
${{ runner.os }}-rust-
78+
- name: Install rust-src component
79+
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
6680
- name: Build Standard app
6781
id: build
6882
shell: bash -l {0}
@@ -111,16 +125,6 @@ jobs:
111125
run: cd ./app/rust
112126
cargo test
113127

114-
setup_rust:
115-
runs-on: ubuntu-latest
116-
outputs:
117-
cargo_home: ${{ steps.set_paths.outputs.cargo_home }}
118-
rustup_home: ${{ steps.set_paths.outputs.rustup_home }}
119-
steps:
120-
- id: set_paths
121-
run: |
122-
echo "cargo_home=$GITHUB_WORKSPACE/app/rust/.cargo" >> $GITHUB_OUTPUT
123-
echo "rustup_home=$GITHUB_WORKSPACE/app/rust/.rustup" >> $GITHUB_OUTPUT
124128

125129
build_application:
126130
name: Build application using the reusable workflow
@@ -225,20 +229,21 @@ jobs:
225229
BOLOS_SDK: /opt/nanos-secure-sdk
226230
HOME: /root
227231
CARGO_HOME: ${{ needs.setup_rust.outputs.cargo_home }}
228-
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
232+
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
229233
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${{ needs.setup_rust.outputs.cargo_home }}/bin
230234
steps:
231235
- name: Checkout
232236
uses: actions/checkout@v4
233237
with:
234-
submodules: recursive
238+
submodules: true
239+
- name: Install deps
240+
run: pip install ledgerblue --break-system-packages
235241
- name: Setup Rust environment
236242
uses: actions-rs/toolchain@v1
237243
with:
238244
toolchain: stable
239245
target: thumbv6m-none-eabi
240246
override: true
241-
profile: minimal
242247
- name: Cache Rust dependencies
243248
uses: actions/cache@v3
244249
with:
@@ -248,9 +253,8 @@ jobs:
248253
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
249254
restore-keys: |
250255
${{ runner.os }}-rust-
251-
- name: Install deps
252-
run: pip install ledgerblue --break-system-packages
253-
256+
- name: Install rust-src component
257+
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
254258
- name: Build NanoS
255259
shell: bash -l {0}
256260
run: |
@@ -289,20 +293,21 @@ jobs:
289293
BOLOS_SDK: /opt/nanosplus-secure-sdk
290294
HOME: /root
291295
CARGO_HOME: ${{ needs.setup_rust.outputs.cargo_home }}
292-
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
296+
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
293297
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${{ needs.setup_rust.outputs.cargo_home }}/bin
294298
steps:
295299
- name: Checkout
296300
uses: actions/checkout@v4
297301
with:
298-
submodules: recursive
302+
submodules: true
303+
- name: Install deps
304+
run: pip install ledgerblue --break-system-packages
299305
- name: Setup Rust environment
300306
uses: actions-rs/toolchain@v1
301307
with:
302308
toolchain: stable
303309
target: thumbv6m-none-eabi
304310
override: true
305-
profile: minimal
306311
- name: Cache Rust dependencies
307312
uses: actions/cache@v3
308313
with:
@@ -312,9 +317,8 @@ jobs:
312317
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
313318
restore-keys: |
314319
${{ runner.os }}-rust-
315-
- name: Install deps
316-
run: pip install ledgerblue --break-system-packages
317-
320+
- name: Install rust-src component
321+
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
318322
- name: Build NanoSP
319323
shell: bash -l {0}
320324
run: |
@@ -353,20 +357,21 @@ jobs:
353357
BOLOS_SDK: /opt/stax-secure-sdk
354358
HOME: /root
355359
CARGO_HOME: ${{ needs.setup_rust.outputs.cargo_home }}
356-
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
360+
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
357361
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${{ needs.setup_rust.outputs.cargo_home }}/bin
358362
steps:
359363
- name: Checkout
360364
uses: actions/checkout@v4
361365
with:
362-
submodules: recursive
366+
submodules: true
367+
- name: Install deps
368+
run: pip install ledgerblue --break-system-packages
363369
- name: Setup Rust environment
364370
uses: actions-rs/toolchain@v1
365371
with:
366372
toolchain: stable
367373
target: thumbv6m-none-eabi
368374
override: true
369-
profile: minimal
370375
- name: Cache Rust dependencies
371376
uses: actions/cache@v3
372377
with:
@@ -376,8 +381,8 @@ jobs:
376381
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
377382
restore-keys: |
378383
${{ runner.os }}-rust-
379-
- name: Install deps
380-
run: pip install ledgerblue --break-system-packages
384+
- name: Install rust-src component
385+
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
381386

382387
- name: Build Stax
383388
shell: bash -l {0}
@@ -392,8 +397,7 @@ jobs:
392397
env:
393398
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
394399
with:
395-
files: |
396-
./app/pkg/installer_stax.sh
400+
files: ./app/pkg/installer_stax.sh
397401
tag_name: ${{ steps.stax.outputs.tag_name }}
398402
draft: false
399403
prerelease: false
@@ -417,20 +421,21 @@ jobs:
417421
BOLOS_SDK: /opt/flex-secure-sdk
418422
HOME: /root
419423
CARGO_HOME: ${{ needs.setup_rust.outputs.cargo_home }}
420-
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
424+
RUSTUP_HOME: ${{ needs.setup_rust.outputs.rustup_home }}
421425
PATH: /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:${{ needs.setup_rust.outputs.cargo_home }}/bin
422426
steps:
423427
- name: Checkout
424428
uses: actions/checkout@v4
425429
with:
426-
submodules: recursive
430+
submodules: true
431+
- name: Install deps
432+
run: pip install ledgerblue --break-system-packages
427433
- name: Setup Rust environment
428434
uses: actions-rs/toolchain@v1
429435
with:
430436
toolchain: stable
431437
target: thumbv6m-none-eabi
432438
override: true
433-
profile: minimal
434439
- name: Cache Rust dependencies
435440
uses: actions/cache@v3
436441
with:
@@ -440,8 +445,8 @@ jobs:
440445
key: ${{ runner.os }}-rust-${{ hashFiles('**/Cargo.lock') }}
441446
restore-keys: |
442447
${{ runner.os }}-rust-
443-
- name: Install deps
444-
run: pip install ledgerblue --break-system-packages
448+
- name: Install rust-src component
449+
run: rustup component add rust-src --toolchain stable-x86_64-unknown-linux-gnu
445450

446451
- name: Build Flex
447452
shell: bash -l {0}
@@ -456,8 +461,7 @@ jobs:
456461
env:
457462
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token
458463
with:
459-
files: |
460-
./app/pkg/installer_flex.sh
464+
files: ./app/pkg/installer_flex.sh
461465
tag_name: ${{ steps.flex.outputs.tag_name }}
462466
draft: false
463467
prerelease: false

app/Makefile.version

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,4 +3,4 @@ APPVERSION_M=4
33
# This is the minor version of this release
44
APPVERSION_N=0
55
# This is the patch version of this release
6-
APPVERSION_P=2
6+
APPVERSION_P=3
47 Bytes
Loading
47 Bytes
Loading
-5 Bytes
Loading
-5 Bytes
Loading
-2 Bytes
Loading
-2 Bytes
Loading
-9 Bytes
Loading
-9 Bytes
Loading

0 commit comments

Comments
 (0)