1
0
mirror of https://github.com/trezor/trezor-firmware.git synced 2024-12-18 04:18:10 +00:00

feat(ci): add fmt and unit tests for rust in CI

This commit is contained in:
wszdexdrf 2023-06-06 09:36:10 +05:30 committed by matejcik
parent 07ba960ab4
commit 379446cad7
3 changed files with 17 additions and 4 deletions

View File

@ -86,11 +86,13 @@ 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
ruststyle_check:
rustfmt --version
@echo [RUSTFMT]
@cd core/embed/rust ; cargo fmt -- --check
@cd rust/trezor-client ; cargo fmt -- --check
python_support_check:
./tests/test_python_support.py

View File

@ -674,6 +674,15 @@ python support test:
script:
- $NIX_SHELL --run "poetry run make python_support_check | ts -s"
# Rust
rust test:
stage: test
<<: *gitlab_caching
needs:
- core unix frozen debug build
script:
- $NIX_SHELL --run "poetry run core/emu.py --headless -q --temporary-profile --slip0014 --command cargo test --manifest-path rust/trezor-client/Cargo.toml | ts -s"
# Storage

View File

@ -142,7 +142,7 @@ Bitcoin-only version.
## TEST stage - [test.yml](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml)
All the tests run test cases on the freshly built emulators from the previous `BUILD` stage.
Consists of **35 jobs** below:
Consists of **36 jobs** below:
### [core unit python test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L15)
Python unit tests, checking core functionality.
@ -226,11 +226,13 @@ Legacy device test - UI.
### [python support test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L670)
### [storage test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L680)
### [rust test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L679)
### [core unix memory profiler](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L704)
### [storage test](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L689)
### [connect test core](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L728)
### [core unix memory profiler](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L713)
### [connect test core](https://github.com/trezor/trezor-firmware/blob/master/ci/test.yml#L737)
---
## TEST-HW stage - [test-hw.yml](https://github.com/trezor/trezor-firmware/blob/master/ci/test-hw.yml)