diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..fe012999 --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,42 @@ +name: SDK Rust CI + +on: + push: + branches: + - main + pull_request: + branches: + - '*' + +env: + CARGO_TERM_COLOR: always + +jobs: + test: + name: cargo test + strategy: + matrix: + os: [ ubuntu-latest, macos-latest, windows-latest ] + rust: [stable, nightly] + runs-on: ${{ matrix.os }} + steps: + - uses: actions/checkout@v4 + - name: Set up Rust + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: ${{ matrix.rust }} + - name: Test + run: cargo test --workspace + format: + name: cargo fmt + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Setup Rustfmt + uses: actions-rust-lang/setup-rust-toolchain@v1 + with: + toolchain: stable + components: rustfmt + - name: Rustfmt Check + id: rustfmt-check + uses: actions-rust-lang/rustfmt@v1 diff --git a/crates/credentials/src/pex/v2/presentation_definition.rs b/crates/credentials/src/pex/v2/presentation_definition.rs index 70072c89..a8b57576 100644 --- a/crates/credentials/src/pex/v2/presentation_definition.rs +++ b/crates/credentials/src/pex/v2/presentation_definition.rs @@ -145,11 +145,11 @@ pub enum Optionality { #[cfg(test)] mod tests { use super::*; + use serde_canonical_json::CanonicalFormatter; + use serde_json::Serializer; use serde_json::{json, Value}; use std::fs; use std::path::Path; - use serde_json::Serializer; - use serde_canonical_json::CanonicalFormatter; #[test] fn can_serialize() { @@ -191,7 +191,8 @@ mod tests { let json_value = String::from_utf8(ser.into_inner()).unwrap(); let mut ser = Serializer::with_formatter(Vec::new(), CanonicalFormatter::new()); - let deserialized_with_type: PresentationDefinition = serde_json::from_str(&raw_string).unwrap(); + let deserialized_with_type: PresentationDefinition = + serde_json::from_str(&raw_string).unwrap(); deserialized_with_type.serialize(&mut ser).unwrap(); let json_serialized_from_type = String::from_utf8(ser.into_inner()).unwrap();