diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index acfef652..4c6fd41b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -78,6 +78,29 @@ jobs: - name: Check with clippy run: cargo clippy --all + book_examples: + name: Test book examples + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v2 + with: + submodules: true + - uses: actions-rs/toolchain@v1 + with: + toolchain: stable + override: true + - name: Install mdBook + uses: peaceiris/actions-mdbook@v1 + - name: Build with all features + run: cargo build --workspace --all-features + - name: Run book tests for en language + run: mdbook test -L target/debug/deps ./docs/en + - name: Run book tests for zh-CN language + run: mdbook test -L target/debug/deps ./docs/zh-CN + - name: Clean + run: cargo clean + examples: name: Build examples - Rust (${{ matrix.rust }}) on ${{ matrix.os }} runs-on: ${{ matrix.os }} diff --git a/docs/en/book.toml b/docs/en/book.toml index 0eac281a..b19c00bb 100644 --- a/docs/en/book.toml +++ b/docs/en/book.toml @@ -4,3 +4,6 @@ description = "Async-graphql Book" src = "src" language = "en" title = "Async-graphql Book" + +[rust] +edition = "2021" diff --git a/docs/zh-CN/book.toml b/docs/zh-CN/book.toml index c1b449c8..fa8cedeb 100644 --- a/docs/zh-CN/book.toml +++ b/docs/zh-CN/book.toml @@ -4,3 +4,6 @@ description = "Async-graphql使用手册" src = "src" language = "zh-CN" title = "Async-graphql教程" + +[rust] +edition = "2021"