From 03ca1634a53d7dfa7dbef4b5a6e5243e4c2d0cba Mon Sep 17 00:00:00 2001 From: Graydon Hoare Date: Wed, 10 Apr 2024 11:44:34 -0700 Subject: [PATCH] Test commit to try matrix-based TEST_PROTOCOL dispatch --- .github/workflows/rust.yml | 7 ++++--- soroban-env-host/src/test/host.rs | 9 +++++++++ 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6b10842e2..1eacfc3c1 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -78,6 +78,7 @@ jobs: strategy: matrix: rust: [msrv, latest] + test-protocol: [20, 21] sys: - os: ubuntu-latest target: wasm32-unknown-unknown @@ -114,9 +115,9 @@ jobs: version: 0.5.28 - run: cargo hack --each-feature clippy --locked --target ${{ matrix.sys.target }} - if: matrix.sys.test - run: TEST_PROTOCOL=20 cargo hack --each-feature test --profile test-opt --locked --target ${{ matrix.sys.target }} - - if: matrix.sys.test - run: TEST_PROTOCOL=21 cargo hack --each-feature test --profile test-opt --locked --target ${{ matrix.sys.target }} + run: cargo hack --each-feature test --profile test-opt --locked --target ${{ matrix.sys.target }} + - env: + TEST_PROTOCOL: ${{ matrix.test-protocol }} publish-dry-run: if: github.event_name == 'push' || startsWith(github.head_ref, 'release/') diff --git a/soroban-env-host/src/test/host.rs b/soroban-env-host/src/test/host.rs index b68818b0e..49f941018 100644 --- a/soroban-env-host/src/test/host.rs +++ b/soroban-env-host/src/test/host.rs @@ -7,6 +7,15 @@ use crate::{ Env, Host, HostError, }; +// This is just a temporary test to confirm that matrix-based env vars work +// on github CI. +#[test] +fn check_test_protocol_is_21(env: &Env) { + let val = env.get("TEST_PROTOCOL").unwrap(); + let val = val.to_u64().unwrap(); + assert_eq!(val, 21); +} + #[test] fn invalid_object_handles() -> Result<(), HostError> { let create_host = || -> Result {