mirror of
https://github.com/trezor/trezor-firmware.git
synced 2026-02-19 16:22:44 +01:00
ci: stylecheck and test all rust crates
[no changelog]
This commit is contained in:
10
.github/workflows/common.yml
vendored
10
.github/workflows/common.yml
vendored
@@ -79,6 +79,16 @@ jobs:
|
||||
# LD_LIBRARY_PATH workaround: https://discourse.nixos.org/t/nixpkgs-nixos-unstable-many-package-fail-with-glibc-2-38-not-found/35078 https://github.com/NixOS/nixpkgs/issues/287764
|
||||
- run: nix-shell --arg fullDeps true --run "unset LD_LIBRARY_PATH && cd python && uv run tox"
|
||||
|
||||
rust_test:
|
||||
name: Rust crates test
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
with:
|
||||
submodules: recursive
|
||||
- uses: ./.github/actions/environment
|
||||
- run: nix-shell --run "make -C rust check"
|
||||
|
||||
storage_test:
|
||||
name: Storage test
|
||||
# TODO: only for changes in storage/
|
||||
|
||||
5
Makefile
5
Makefile
@@ -94,13 +94,14 @@ defs_check: ## check validity of coin definitions and protobuf files
|
||||
ruststyle:
|
||||
@echo [RUSTFMT]
|
||||
@cd core/embed/rust ; cargo fmt
|
||||
@cd rust/trezor-client ; cargo fmt
|
||||
make -C rust style
|
||||
|
||||
ruststyle_check:
|
||||
rustfmt --version
|
||||
@echo [RUSTFMT]
|
||||
@cd core/embed/rust ; cargo fmt -- --check
|
||||
@cd rust/trezor-client ; cargo fmt -- --check
|
||||
make -C rust style_check
|
||||
|
||||
|
||||
typecheck: pyright
|
||||
|
||||
|
||||
1
rust/.gitignore
vendored
Normal file
1
rust/.gitignore
vendored
Normal file
@@ -0,0 +1 @@
|
||||
*/target/
|
||||
33
rust/Makefile
Normal file
33
rust/Makefile
Normal file
@@ -0,0 +1,33 @@
|
||||
# trezor-client needs running emulator for test, handled in core.yml
|
||||
CRATES_TEST = trezor-thp trezor-tjpgdec
|
||||
CRATES = ${CRATES_TEST} trezor-client
|
||||
|
||||
check: clippy test
|
||||
|
||||
style:
|
||||
@for D in $(CRATES); do ( \
|
||||
echo "[STYLE $$D]"; \
|
||||
cd $$D; \
|
||||
cargo fmt \
|
||||
); done
|
||||
|
||||
style_check:
|
||||
@for D in $(CRATES); do ( \
|
||||
echo "[STYLE $$D]"; \
|
||||
cd $$D; \
|
||||
cargo fmt -- --check \
|
||||
); done
|
||||
|
||||
clippy:
|
||||
@for D in $(CRATES); do ( \
|
||||
echo "[CLIPPY $$D]"; \
|
||||
cd $$D; \
|
||||
cargo clippy \
|
||||
); done
|
||||
|
||||
test:
|
||||
@for D in $(CRATES_TEST); do ( \
|
||||
echo "[TEST $$D]"; \
|
||||
cd $$D; \
|
||||
cargo test \
|
||||
); done
|
||||
1
rust/trezor-client/.gitignore
vendored
1
rust/trezor-client/.gitignore
vendored
@@ -1 +0,0 @@
|
||||
target/
|
||||
Reference in New Issue
Block a user