name: CI # Build verification on PRs (and pushes to main, redundantly with the # publish workflow but harmless and gives faster feedback). # # No publishing or signing — that's publish.yml's job. This workflow # just confirms the code compiles for both targets (esp32 firmware # and the host-side publisher tool). on: pull_request: push: branches: [main] workflow_dispatch: # Per-PR concurrency: a new push to a branch cancels the in-flight CI # for older commits on the same branch. Doesn't affect other PRs. concurrency: group: ci-${{ github.ref }} cancel-in-progress: true permissions: contents: read jobs: firmware: name: build firmware runs-on: ubuntu-latest timeout-minutes: 30 steps: - uses: actions/checkout@v6 - name: Install cmake + ninja run: sudo apt-get update && sudo apt-get install -y cmake ninja-build - name: Setup uv (for python-shim) uses: astral-sh/setup-uv@v7 - name: Setup Xtensa toolchain (espup) uses: esp-rs/xtensa-toolchain@v1.7 with: default: true buildtargets: esp32 ldproxy: true # Intentionally not caching .embuild here. Sharing the cache # with publish.yml led to "too many levels of symbolic links" # in the IDF venv (absolute symlinks baked in by one runner # don't resolve cleanly on another). CI gets a slower cold # build each time; the trade-off is reproducibility. - name: Cache cargo build uses: Swatinem/rust-cache@v2 with: shared-key: ci-firmware - name: Build firmware # No wifi.env needed — the firmware reads Wi-Fi creds from NVS # at runtime, not from env!() at compile time. The published # OCI image is device-agnostic. run: make build publisher: name: build publisher runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v6 - uses: Swatinem/rust-cache@v2 with: workspaces: tools/publisher shared-key: ci-publisher - name: Build publisher # Explicit --target overrides the parent .cargo/config.toml's # `target = "xtensa-esp32-espidf"`. Hardcoded triple is fine # because we control the runner (ubuntu-latest = x86_64-linux). run: cd tools/publisher && cargo build --release --target x86_64-unknown-linux-gnu provision: name: build provision runs-on: ubuntu-latest timeout-minutes: 15 steps: - uses: actions/checkout@v6 - uses: Swatinem/rust-cache@v2 with: workspaces: tools/provision shared-key: ci-provision - name: Build provision run: cd tools/provision && cargo build --release --target x86_64-unknown-linux-gnu