Merge pull request #560 from Foundation-Devices/dev-v2.3.4 #336
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# SPDX-FileCopyrightText: © 2024 Foundation Devices, Inc. <[email protected]> | |
# 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 |