Skip to content

Commit

Permalink
Github Actions (#26)
Browse files Browse the repository at this point in the history
  • Loading branch information
amika-sq authored Dec 4, 2023
1 parent c5afb21 commit a9d41fb
Show file tree
Hide file tree
Showing 2 changed files with 46 additions and 3 deletions.
42 changes: 42 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -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
7 changes: 4 additions & 3 deletions crates/credentials/src/pex/v2/presentation_definition.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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();

Expand Down

0 comments on commit a9d41fb

Please sign in to comment.