1
0
Fork 0
mirror of https://github.com/imjasonh/esp32 synced 2026-07-06 23:52:24 +00:00
esp32/.github/workflows/ci.yml
Jason Hall 0e9559f375 CI: drop .embuild cache (corruption across runners), pass --target on publisher
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-02 14:27:42 -04:00

87 lines
2.6 KiB
YAML

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: Write placeholder wifi.env
# The firmware embeds WIFI_SSID/WIFI_PASS at compile time via
# env!() but doesn't validate them. CI just needs the build to
# succeed; runtime Wi-Fi connect with these placeholders would
# fail, but that's not what CI is testing.
run: |
{
echo 'export WIFI_SSID="ci-placeholder"'
echo 'export WIFI_PASS="ci-placeholder"'
} > wifi.env
- name: Build firmware
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