Unverified Commit 29a900e7 authored by Harry Barber's avatar Harry Barber Committed by GitHub
Browse files

Add CI to the book (#2027)

## Motivation and Context

Closes https://github.com/awslabs/smithy-rs/issues/2004



## Description

Run `mdbook test` over the `design` folder.

## TODO

- [x] Ignore the RFC sections using `ignore` tag on the code blocks.
- [ ] Fix the remaining examples.
- [x] Ensure local `rust-runtime` dependencies are being used.

---------

Signed-off-by: default avatarDaniele Ahmed <ahmeddan@amazon.de>
Co-authored-by: default avatar82marbag <69267416+82marbag@users.noreply.github.com>
parent 3285c43b
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
@@ -111,6 +111,8 @@ jobs:
          runner: ubuntu-latest
        - action: check-style-and-lints
          runner: ubuntu-latest
        - action: check-book
          runner: ubuntu-latest
        - action: check-tools
          runner: smithy_ubuntu-latest_8-core
        - action: check-deterministic-codegen
+4 −0
Original line number Diff line number Diff line
@@ -52,6 +52,10 @@ check-aws-sdk-smoketest-unit-tests: generate-aws-sdk-smoketest
check-aws-sdk-standalone-integration-tests: generate-aws-sdk-smoketest
	$(CI_ACTION) $@ $(ARGS)

.PHONY: check-book
check-book: check-rust-runtimes
	$(CI_ACTION) $@ $(ARGS)

.PHONY: check-client-codegen-integration-tests
check-client-codegen-integration-tests:
	$(CI_ACTION) $@ $(ARGS)
+4 −1
Original line number Diff line number Diff line
[book]
title = "Smithy Rust"
authors = ["Russell Cohen", "aws-sdk-rust@amazon.com"]
language = "en"
multilingual = false
src = "src"
title = "AWS Rust SDK Design"

[rust]
edition = "2021"

[preprocessor.mermaid]
command = "mdbook-mermaid"
+0 −1
Original line number Diff line number Diff line
@@ -24,7 +24,6 @@
  - [Accessing Un-modelled Data](./server/from_parts.md)
  - [The Anatomy of a Service](./server/anatomy.md)
  - [Generating Common Service Code](./server/code_generation.md)
  - [Generating the Pokémon Service](./server/pokemon_service.md)

- [RFCs](./rfcs/overview.md)
  - [RFC-0001: Sharing configuration between multiple clients](./rfcs/rfc0001_shared_config.md)
+4 −4
Original line number Diff line number Diff line
@@ -85,7 +85,7 @@ unmaintainable levels if each configurable implementation in it was made generic

These traits look like this:

```rust
```rust,ignore
#[derive(Clone, Debug)]
pub struct HttpAuthOption {
    scheme_id: &'static str,
@@ -123,7 +123,7 @@ will need to understand what the concrete data type underlying that identity is.
uses a `Arc<dyn Any>` to represent the actual identity data so that generics are not needed in
the traits:

```rust
```rust,ignore
#[derive(Clone, Debug)]
pub struct Identity {
    data: Arc<dyn Any + Send + Sync>,
@@ -136,7 +136,7 @@ rather than `Box`. This also reduces the allocations required. The signer implem
will use downcasting to access the identity data types they understand. For example, with AWS SigV4,
it might look like the following:

```rust
```rust,ignore
fn sign_request(
    &self,
    request: &mut HttpRequest,
@@ -162,7 +162,7 @@ to verify that that type is that trait is lost at compile time (a `std::any::Typ
about the concrete type).

In an ideal world, it would be possible to extract the expiration like this:
```rust
```rust,ignore
pub trait ExpiringIdentity {
    fn expiration(&self) -> SystemTime;
}
Loading