diff --git a/.github/workflows/cd-test.yml b/.github/workflows/cd-test.yml new file mode 100644 index 0000000..f7dbff7 --- /dev/null +++ b/.github/workflows/cd-test.yml @@ -0,0 +1,15 @@ +name: Continuous delivery - test + +on: + pull_request: + # opened, reopenened, synchronize are the default types for pull_request + # labeled, unlabeled ensure this check is also run if a label is added or removed + types: [opened, reopened, synchronize, labeled, unlabeled] + +jobs: + test-publish: + runs-on: ubuntu-latest + if: ${{ !contains(github.event.pull_request.labels.*.name, 'skip-publish-check') }} + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - run: cargo publish --dry-run diff --git a/.github/workflows/cd.yml b/.github/workflows/cd.yml new file mode 100644 index 0000000..3c68932 --- /dev/null +++ b/.github/workflows/cd.yml @@ -0,0 +1,19 @@ +name: Continuous delivery - crates.io + +on: + release: + types: [published] + +jobs: + publish: + runs-on: ubuntu-latest + environment: crates.io + permissions: + id-token: write + steps: + - uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2 + - uses: rust-lang/crates-io-auth-action@b7e9a28eded4986ec6b1fa40eeee8f8f165559ec # v1.0.3 + id: auth + - run: cargo publish + env: + CARGO_REGISTRY_TOKEN: ${{ steps.auth.outputs.token }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3de1ac8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,78 @@ +name: CI + +on: [push, pull_request] + +jobs: + build: + name: Check library + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Check library + run: | + cargo check --all-targets + cargo check --all-features --all-targets + + build-no-std: + name: Check library (no-std) + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + target: x86_64-unknown-linux-gnu + override: true + - name: Check library (no-std) + run: | + cargo check + cargo check --all-features + + test: + name: Run tests + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + - name: Run tests + run: cargo test + - name: Run tests with all features + run: cargo test --all-features + + clippy: + name: Run clippy + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: "clippy" + - name: Run clippy + run: cargo clippy --all-targets -- -D warnings + + fmt: + name: Run rustfmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@master + - uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: "rustfmt" + - name: Run rustfmt + run: cargo fmt -- --check diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 0000000..6a7fb2c --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,28 @@ +# Changelog +All notable changes to this project will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). + +## [Unreleased] + +[Unreleased]: https://github.com/trussed-dev/admin-app/compare/0.2.0...HEAD + +- + +## [0.2.0] 2026-07-22 + +[0.2.0]: https://github.com/trussed-dev/admin-app/compare/0.1.0...0.2.0 + +- Update to trussed v0.2. +- Introduce ADMIN vendor command as a namespace for all other commands. +- Add factory reset command. +- Add config commands. +- Add status command. +- Add test-se050 command. + +## [0.1.0] - 2022-03-17 + +[0.1.0]: https://github.com/trussed-dev/admin-app/releases/tag/0.1.0 + +Initial release. diff --git a/Cargo.toml b/Cargo.toml index 3aaf0ad..736c2b8 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "admin-app" -version = "0.1.0" +version = "0.2.0" authors = ["Conor Patrick ", "Nicolas Stalder "] repository = "https://github.com/solokeys/admin-app" edition = "2021" @@ -15,11 +15,11 @@ delog = "0.1" heapless = "0.9" heapless-bytes = { version = "0.5", features = ["heapless-0.9"] } iso7816 = "0.2" -littlefs2 = { version = "0.7", optional = true } +littlefs2 = { version = "0.8", optional = true } littlefs2-core = { version = "0.1", features = ["heapless-bytes05"] } serde = { version = "1.0.180", default-features = false } strum_macros = "0.25.2" -trussed = { version = "=0.2.0-rc.1", default-features = false } +trussed = { version = "0.2", default-features = false } trussed-core = { version = "0.2", features = ["crypto-client", "filesystem-client", "management-client", "ui-client"] } embedded-hal = { version = "0.2.7", optional = true } diff --git a/src/config.rs b/src/config.rs index 7031d2d..eafa330 100644 --- a/src/config.rs +++ b/src/config.rs @@ -245,8 +245,8 @@ impl<'a> ConfigValueMut<'a> { impl<'a> Display for ConfigValueMut<'a> { fn fmt(&self, f: &mut Formatter<'_>) -> fmt::Result { match self { - Self::Bool(value) => write!(f, "{}", value), - Self::U8(value) => write!(f, "{}", value), + Self::Bool(value) => write!(f, "{value}"), + Self::U8(value) => write!(f, "{value}"), } } } @@ -281,7 +281,7 @@ pub fn get( response: &mut VecView, ) -> Result<(), ConfigError> { let field = config.field(key).ok_or(ConfigError::InvalidKey)?; - write!(response, "{}", field).map_err(|_| ConfigError::DataTooLong) + write!(response, "{field}").map_err(|_| ConfigError::DataTooLong) } pub fn set(config: &mut C, key: &str, value: &str) -> Result<(), ConfigError> { diff --git a/src/migrations.rs b/src/migrations.rs index 3dc03da..0e77e24 100644 --- a/src/migrations.rs +++ b/src/migrations.rs @@ -91,8 +91,6 @@ pub mod test_utils { block_size = 512, block_count = 128, lookahead_size_ty = littlefs2::consts::U8, - filename_max_plus_one_ty = littlefs2::consts::U256, - path_max_plus_one_ty = littlefs2::consts::U256, ); pub fn test_migration_one(