diff --git a/.github/workflows/rust-build.yml b/.github/workflows/rust-build.yml index d28224ce..e61c2a52 100644 --- a/.github/workflows/rust-build.yml +++ b/.github/workflows/rust-build.yml @@ -47,3 +47,17 @@ jobs: - run: | cd gen/pb-rust cargo build --verbose + + test: + runs-on: ubuntu-latest + strategy: + matrix: + toolchain: + - stable + + steps: + - uses: actions/checkout@v3 + - run: rustup update ${{ matrix.toolchain }} && rustup default ${{ matrix.toolchain }} + - run: | + cd gen/pb-rust + cargo test --tests diff --git a/gen/pb-rust/tests/integration.rs b/gen/pb-rust/tests/integration.rs index 48271bb7..6ef078f9 100644 --- a/gen/pb-rust/tests/integration.rs +++ b/gen/pb-rust/tests/integration.rs @@ -2,8 +2,7 @@ use pretty_assertions::{assert_eq, assert_ne}; use serde_json; use sigstore_protobuf_specs::{ Bundle, DevSigstoreBundleV1VerificationMaterial as VerificationMaterial, - DevSigstoreCommonV1HashOutput as HashOutput, - DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1LogId as LogId, + DevSigstoreCommonV1HashOutput as HashOutput, DevSigstoreCommonV1LogId as LogId, DevSigstoreCommonV1MessageSignature as MessageSignature, DevSigstoreCommonV1X509Certificate as X509Certificate, DevSigstoreCommonV1X509CertificateChain as X509CertificateChain, @@ -75,7 +74,7 @@ fn bundle() { }), message_signature: Some(MessageSignature { message_digest: Some(HashOutput{ - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + algorithm: Some(String::from("SHA2_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")) }), signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g==")) diff --git a/gen/pb-rust/tests/unit.rs b/gen/pb-rust/tests/unit.rs index 6d523f54..f6346a4e 100644 --- a/gen/pb-rust/tests/unit.rs +++ b/gen/pb-rust/tests/unit.rs @@ -1,6 +1,5 @@ use sigstore_protobuf_specs::{ DevSigstoreCommonV1HashOutput as HashOutput, - DevSigstoreCommonV1HashOutputAlgorithm as HashAlgorithm, DevSigstoreCommonV1MessageSignature as MessageSignature, }; @@ -8,7 +7,7 @@ use sigstore_protobuf_specs::{ #[test] fn primitives() { let hash_output = HashOutput { - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA2_256"))), + algorithm: Some(String::from("SHA2_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), }; @@ -25,7 +24,7 @@ fn primitives() { fn nested() { let message_signature= MessageSignature { message_digest: Some(HashOutput { - algorithm: Some(HashAlgorithm::Variant0(String::from("SHA_256"))), + algorithm: Some(String::from("SHA_256")), digest: Some(String::from("gC3WD/iDM4AvJYXnMEO9IcNBKF4Zkv5bMXVeHK3q4w4=")), }), signature: Some(String::from("MGUCMQCOOJqTY6XWgB64izK2WVP07b0SG9M5WPCwKhfTPwMvtsgUi8KeRGwQkvvLYbKHdqUCMEbOXFG0NMqEQxWVb6rmGnexdADuGf6Jl8qAC8tn67p3QfVoXzMvFA61PzxwVwvb8g=="))