Skip to content

Commit b07ebcc

Browse files
committed
1 parent 51b7abe commit b07ebcc

File tree

1 file changed

+98
-0
lines changed

1 file changed

+98
-0
lines changed

.github/workflows/rust.yml

Lines changed: 98 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,98 @@
1+
name: Rust
2+
3+
on:
4+
push:
5+
branches: [ main, develop ]
6+
pull_request:
7+
branches: [ main, develop ]
8+
workflow_dispatch:
9+
inputs:
10+
name:
11+
description: 'Manually triggered'
12+
13+
env:
14+
CARGO_TERM_COLOR: always
15+
16+
jobs:
17+
fmt:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- name: Checkout
21+
uses: actions/checkout@v3
22+
- uses: actions-rs/toolchain@v1
23+
with:
24+
toolchain: nightly
25+
override: true
26+
components: rust-src, rustfmt
27+
- run: rustup component add rustfmt
28+
- name: Cargo fmt
29+
uses: actions-rs/cargo@v1
30+
with:
31+
command: fmt
32+
args: --all -- --check
33+
clippy:
34+
runs-on: ubuntu-latest
35+
strategy:
36+
matrix:
37+
device: [nanos, nanox, nanosplus]
38+
env:
39+
OBJCOPY: arm-none-eabi-objcopy
40+
NM: arm-none-eabi-nm
41+
steps:
42+
- name: arm-none-eabi-gcc
43+
uses: fiam/[email protected]
44+
with:
45+
release: '9-2019-q4'
46+
- name: Checkout
47+
uses: actions/checkout@v3
48+
- name: Checkout SDK (targets)
49+
uses: actions/checkout@v3
50+
with:
51+
repository: 'alamgu/ledger-nanos-sdk'
52+
ref: memory-fixes
53+
path: rsdk
54+
- uses: actions-rs/toolchain@v1
55+
with:
56+
toolchain: nightly
57+
override: true
58+
components: rust-src, clippy
59+
- run: rustup component add clippy
60+
- name: Cargo clippy
61+
uses: actions-rs/cargo@v1
62+
with:
63+
command: clippy
64+
args: -Z build-std=core -Z build-std-features=compiler-builtins-mem --target ./rsdk/${{ matrix.device }}.json
65+
build:
66+
runs-on: ubuntu-latest
67+
strategy:
68+
matrix:
69+
device: [nanos, nanox, nanosplus]
70+
env:
71+
OBJCOPY: arm-none-eabi-objcopy
72+
NM: arm-none-eabi-nm
73+
steps:
74+
- name: arm-none-eabi-gcc
75+
uses: fiam/[email protected]
76+
with:
77+
release: '9-2019-q4'
78+
- name: Checkout
79+
uses: actions/checkout@v3
80+
- name: Checkout SDK (targets)
81+
uses: actions/checkout@v3
82+
with:
83+
repository: 'alamgu/ledger-nanos-sdk'
84+
ref: memory-fixes
85+
path: rsdk
86+
- name: Install clang
87+
run: sudo apt-get update && sudo apt install -y clang
88+
- uses: actions-rs/toolchain@v1
89+
with:
90+
toolchain: nightly
91+
override: true
92+
components: rust-src
93+
- run: echo "$PWD/rsdk/scripts" >> $GITHUB_PATH
94+
- name: Cargo build
95+
uses: actions-rs/cargo@v1
96+
with:
97+
command: build
98+
args: -Z build-std=core -Z build-std-features=compiler-builtins-mem --target ./rsdk/${{ matrix.device }}.json

0 commit comments

Comments
 (0)