| 1 | name: Documentation |
| 2 | |
| 3 | on: |
| 4 | push: |
| 5 | branches: [main] |
| 6 | pull_request: |
| 7 | |
| 8 | concurrency: |
| 9 | group: ${{ github.workflow }}-${{ github.ref }} |
| 10 | cancel-in-progress: true |
| 11 | |
| 12 | permissions: |
| 13 | contents: read |
| 14 | pages: write |
| 15 | id-token: write |
| 16 | |
| 17 | jobs: |
| 18 | docs: |
| 19 | name: All crates |
| 20 | runs-on: ubuntu-latest |
| 21 | |
| 22 | steps: |
| 23 | - name: Checkout repository |
| 24 | uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6 |
| 25 | with: |
| 26 | persist-credentials: false |
| 27 | |
| 28 | - name: Install protoc |
| 29 | uses: taiki-e/install-action@b550161ef8a7bc4f2a671c0b03a18ac9ccedea1e # v2.79.1 |
| 30 | with: |
| 31 | tool: protoc@3.20.3 |
| 32 | |
| 33 | - name: Install Rust |
| 34 | uses: dtolnay/rust-toolchain@e97e2d8cc328f1b50210efc529dca0028893a2d9 # v1 |
| 35 | with: |
| 36 | toolchain: nightly-2026-02-26 |
| 37 | |
| 38 | - name: Install Node.js |
| 39 | uses: actions/setup-node@48b55a011bda9f5d6aeb4c2d9c7362e8dae4041e # v6 |
| 40 | with: |
| 41 | node-version: 20 |
| 42 | |
| 43 | - name: Load cache |
| 44 | uses: Swatinem/rust-cache@c19371144df3bb44fab255c43d04cbc2ab54d1c4 # v2.9.1 |
| 45 | with: |
| 46 | save-if: ${{ github.ref == 'refs/heads/main' }} |
| 47 | |
| 48 | # Keep in sync with xtask docs |
| 49 | - name: Build documentation |
| 50 | env: |
| 51 | RUSTDOCFLAGS: "--enable-index-page -Zunstable-options --cfg docsrs -Dwarnings" |
| 52 | run: |
| 53 | cargo doc --no-deps --workspace --features docsrs --exclude=xtask |
| 54 | |
| 55 | - name: Upload artifact |
| 56 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 57 | uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0 |
| 58 | with: |
| 59 | path: './target/doc/' |
| 60 | |
| 61 | - name: Deploy to GitHub Pages |
| 62 | if: github.event_name == 'push' && github.ref == 'refs/heads/main' |
| 63 | id: deployment |
| 64 | uses: actions/deploy-pages@cd2ce8fcbc39b97be8ca5fce6e763baed58fa128 # v5.0.0 |