-
Notifications
You must be signed in to change notification settings - Fork 10
81 lines (75 loc) · 2.49 KB
/
lint.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
# SPDX-FileCopyrightText: © 2024 Foundation Devices, Inc. <hello@foundationdevices.com>
# SPDX-License-Identifier: GPL-3.0-or-later
name: Lint
on: [push, pull_request]
jobs:
is-reuse-compliant:
name: Is REUSE compliant?
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: fsfe/reuse-action@v2
rust-code-compiles:
name: Rust code compiles?
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.70.0
targets: thumbv7em-none-eabihf
- run: |
cargo check --manifest-path extmod/foundation-rust/Cargo.toml
# Required by secp256k1-sys.
- run: sudo apt-get install -y gcc-arm-none-eabi
- run: |
cargo check --manifest-path extmod/foundation-rust/Cargo.toml \
--target thumbv7em-none-eabihf
is-the-rust-code-formatted:
name: Is the Rust code formatted?
needs: [rust-code-compiles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.70.0
components: rustfmt
- run: |
cargo fmt --manifest-path extmod/foundation-rust/Cargo.toml \
--all -- --check
is-the-python-code-formatted:
name: Is the Python code formatted?
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- run: sudo apt-get install -y pycodestyle
- run: pycodestyle --statistics --exclude translations ports/stm32/boards/Passport
is-foundation-header-up-to-date:
name: Is foundation.h header file up to date?
needs: [rust-code-compiles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.70.0
- run: cargo install cbindgen@^0.24 --locked
- run: |
cbindgen --config extmod/foundation-rust/cbindgen.toml \
--output extmod/foundation-rust/include/foundation.h \
--verify \
extmod/foundation-rust/
rust-tests-pass:
name: Rust tests pass?
needs: [rust-code-compiles]
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: ./.github/actions/rust-toolchain
with:
toolchain: 1.70.0
targets:
- run: |
cargo test --manifest-path extmod/foundation-rust/Cargo.toml \
--features std