|
| 1 | +# Checks the adopter docs (Story 10.2): every relative link and referenced repository path |
| 2 | +# resolves, and every command block of the build guide (docs/build/*.md) either runs against the |
| 3 | +# firmware crates (`<!-- ci:run <dir> -->`, builds only) or, when it needs a board |
| 4 | +# (`<!-- ci:hardware -->`), names only real espflash subcommands. Nothing is ever flashed, and no |
| 5 | +# external link is fetched. Not a required status check. |
| 6 | +# |
| 7 | +# Actions are pinned to a commit; the comment names the release. The firmware setup of the |
| 8 | +# `commands` job is copied from the `firmware` job of ci.yml: keep the two in step. |
| 9 | +name: Docs |
| 10 | + |
| 11 | +on: |
| 12 | + pull_request: |
| 13 | + paths: |
| 14 | + # Everything the docs link to or mirror (the toolchain pins of ci.yml and release.yml). |
| 15 | + - "docs/**" |
| 16 | + - "hardware/**" |
| 17 | + - "README.md" |
| 18 | + - "LICENSE" |
| 19 | + - ".gitignore" |
| 20 | + - "apps/**" |
| 21 | + - "packages/**" |
| 22 | + - "deploy/**" |
| 23 | + - "tests/**" |
| 24 | + - "aspire/**" |
| 25 | + - ".github/workflows/**" |
| 26 | + push: |
| 27 | + branches: |
| 28 | + - main |
| 29 | + paths: |
| 30 | + - "docs/**" |
| 31 | + - "hardware/**" |
| 32 | + - "README.md" |
| 33 | + - "LICENSE" |
| 34 | + - ".gitignore" |
| 35 | + - "apps/**" |
| 36 | + - "packages/**" |
| 37 | + - "deploy/**" |
| 38 | + - "tests/**" |
| 39 | + - "aspire/**" |
| 40 | + - ".github/workflows/**" |
| 41 | + workflow_dispatch: |
| 42 | + |
| 43 | +permissions: |
| 44 | + contents: read |
| 45 | + |
| 46 | +concurrency: |
| 47 | + group: ${{ github.workflow }}-${{ github.ref }} |
| 48 | + cancel-in-progress: ${{ github.event_name == 'pull_request' }} |
| 49 | + |
| 50 | +jobs: |
| 51 | + links: |
| 52 | + name: Links |
| 53 | + runs-on: ubuntu-24.04 |
| 54 | + timeout-minutes: 10 |
| 55 | + steps: |
| 56 | + - name: Check out |
| 57 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 58 | + with: |
| 59 | + persist-credentials: false |
| 60 | + |
| 61 | + - name: Test the doc checks |
| 62 | + run: docs/test.sh |
| 63 | + |
| 64 | + - name: Check links and paths |
| 65 | + run: docs/check-links.sh |
| 66 | + |
| 67 | + commands: |
| 68 | + name: Commands |
| 69 | + runs-on: ubuntu-24.04 |
| 70 | + timeout-minutes: 60 |
| 71 | + env: |
| 72 | + # The same pins as the `firmware` job of ci.yml. |
| 73 | + ESPUP_VERSION: "0.17.1" |
| 74 | + ESP_TOOLCHAIN_VERSION: "1.95.0.0" |
| 75 | + ESPFLASH_VERSION: "4.5.0" |
| 76 | + steps: |
| 77 | + - name: Check out |
| 78 | + uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 |
| 79 | + with: |
| 80 | + persist-credentials: false |
| 81 | + |
| 82 | + # cmake and ninja for the mbedTLS rebuild; libudev for espflash. |
| 83 | + - name: Install build tools |
| 84 | + run: sudo apt-get update && sudo apt-get install --yes --no-install-recommends cmake ninja-build libudev-dev pkg-config |
| 85 | + |
| 86 | + - name: Cache |
| 87 | + uses: Swatinem/rust-cache@6323deb102c322ba6fcbdcafc7e3dddab59af2b6 # v2.9.2 |
| 88 | + with: |
| 89 | + workspaces: | |
| 90 | + apps/rs/hub |
| 91 | + apps/rs/node |
| 92 | + key: espup-${{ env.ESPUP_VERSION }}-esp-${{ env.ESP_TOOLCHAIN_VERSION }}-espflash-${{ env.ESPFLASH_VERSION }} |
| 93 | + cache-bin: "true" |
| 94 | + cache-directories: | |
| 95 | + ~/.rustup/toolchains/esp |
| 96 | + ~/export-esp.sh |
| 97 | +
|
| 98 | + # On the runner's stable toolchain: apps/rs/hub/rust-toolchain.toml names `esp`, which is not |
| 99 | + # installed until the next step. |
| 100 | + - name: Install espup and espflash |
| 101 | + working-directory: apps/rs/hub |
| 102 | + run: | |
| 103 | + if [[ "$(espup --version 2>/dev/null)" != "espup ${ESPUP_VERSION}" ]]; then |
| 104 | + rustup run stable cargo install espup --version "${ESPUP_VERSION}" --locked --force |
| 105 | + fi |
| 106 | + if [[ "$(espflash --version 2>/dev/null)" != "espflash ${ESPFLASH_VERSION}" ]]; then |
| 107 | + rustup run stable cargo install espflash --version "${ESPFLASH_VERSION}" --locked --force |
| 108 | + fi |
| 109 | +
|
| 110 | + - name: Install the esp toolchain |
| 111 | + working-directory: apps/rs/hub |
| 112 | + env: |
| 113 | + GITHUB_TOKEN: ${{ github.token }} |
| 114 | + run: | |
| 115 | + if [[ ! -f "${HOME}/export-esp.sh" ]] || ! rustup run esp rustc --version | grep -qF "(${ESP_TOOLCHAIN_VERSION})"; then |
| 116 | + espup install --toolchain-version "${ESP_TOOLCHAIN_VERSION}" --targets esp32s3 --export-file "${HOME}/export-esp.sh" |
| 117 | + fi |
| 118 | + rustup run esp rustc --version |
| 119 | +
|
| 120 | + # The guide's own install block runs too; with the tools above already in place it reuses them. |
| 121 | + - name: Run the documented commands |
| 122 | + env: |
| 123 | + GITHUB_TOKEN: ${{ github.token }} |
| 124 | + run: | |
| 125 | + docs/check-commands.sh --list |
| 126 | + docs/check-commands.sh |
0 commit comments