diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 6e7ce7805..bc8fe0865 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -17,7 +17,7 @@ jobs: complete: if: always() - needs: [fmt, check-git-rev-deps, build-and-test, docs] + needs: [fmt, check-git-rev-deps, build-and-test, docs, readme] runs-on: ubuntu-latest steps: - if: contains(needs.*.result, 'failure') || contains(needs.*.result, 'cancelled') @@ -132,6 +132,15 @@ jobs: - run: rustup install nightly - run: make doc + readme: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v3 + - uses: stellar/actions/rust-cache@main + - run: rustup install nightly + - run: make readme + - run: git add -N . && git diff HEAD --exit-code + publish-dry-run: if: github.event_name == 'push' || startsWith(github.head_ref, 'release/') strategy: diff --git a/soroban-sdk/README.md b/soroban-sdk/README.md index f707b12d5..2aef6d4c3 100644 --- a/soroban-sdk/README.md +++ b/soroban-sdk/README.md @@ -8,8 +8,9 @@ See [soroban.stellar.org](https://soroban.stellar.org) for documentation. ### Examples ```rust -use soroban_sdk::{contractimpl, vec, BytesN, Env, Symbol, Vec}; +use soroban_sdk::{contract, contractimpl, vec, symbol_short, BytesN, Env, Symbol, Vec}; +#[contract] pub struct HelloContract; #[contractimpl] @@ -21,6 +22,9 @@ impl HelloContract { #[test] fn test() { +# } +# #[cfg(feature = "testutils")] +# fn main() { let env = Env::default(); let contract_id = env.register_contract(None, HelloContract); let client = HelloContractClient::new(&env, &contract_id); @@ -29,6 +33,9 @@ fn test() { assert_eq!(words, vec![&env, symbol_short!("Hello"), symbol_short!("Dev"),]); } +# #[cfg(not(feature = "testutils"))] +# fn main() { } ``` -More examples are available at . +More examples are available at +and .