Skip to content

Commit

Permalink
Test commit to try matrix-based TEST_PROTOCOL dispatch
Browse files Browse the repository at this point in the history
  • Loading branch information
graydon committed Apr 10, 2024
1 parent 7eff8a1 commit 03ca163
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
7 changes: 4 additions & 3 deletions .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -78,6 +78,7 @@ jobs:
strategy:
matrix:
rust: [msrv, latest]
test-protocol: [20, 21]
sys:
- os: ubuntu-latest
target: wasm32-unknown-unknown
Expand Down Expand Up @@ -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/')
Expand Down
9 changes: 9 additions & 0 deletions soroban-env-host/src/test/host.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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<Host, HostError> {
Expand Down

0 comments on commit 03ca163

Please sign in to comment.