Add Android Oboe backend and AMY wire socket transport #226
Workflow file for this run
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: AMY HW CI build | |
| # Cloud half of AMY's hardware CI. Builds THIS PR's AMY into the fixed | |
| # LoadTestChord test sketch (tools/arduino_loadsweep: 6-voice Juno patch, | |
| # one held note every 2 s until a 6-note chord), compiled with -DARDUINO_SPEEDTEST | |
| # to make src/i2s.c print `RENDER_LOAD ms=<ms> render_us=<microseconds` | |
| # on the debug UART at 2 Hz, and | |
| # uploads the firmware as an artifact. "AMY HW CI" (amy-hwci.yml) then | |
| # chains off this run via workflow_run and flashes it on the self-hosted | |
| # AMYboard bench Pi. | |
| # | |
| # PR builds also produce a BASELINE firmware — the same sketch built against | |
| # the merge ref's first parent (the current main tip the PR firmware was | |
| # merged with) — under fw/base/. The bench measures both back-to-back so the | |
| # PR comment shows before/after load and the delta the PR itself causes. | |
| # | |
| # The build runs here (ubuntu-latest, cached esp32 core) and NOT on the Pi so | |
| # the bench stays a dumb flash-and-listen box: even for a fork PR this job is | |
| # safe (sandboxed, no secrets), and the bench workflow's same-repo gate | |
| # decides whether the artifact ever reaches hardware. | |
| on: | |
| pull_request: | |
| paths: | |
| - 'src/**' # only src/ is compiled into firmware | |
| - 'tools/arduino_loadsweep/**' | |
| - '.github/workflows/amy-hwci-build.yml' | |
| - '.github/workflows/amy-hwci.yml' | |
| workflow_dispatch: | |
| permissions: | |
| contents: read | |
| concurrency: | |
| group: amy-hwci-build-${{ github.event.pull_request.number || github.run_id }} | |
| cancel-in-progress: true # a new push supersedes the prior build | |
| env: | |
| ESP32_CORE: 3.3.10 | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v4 | |
| with: | |
| fetch-depth: 2 # the merge commit AND its parents (baseline tree) | |
| - name: Stage the baseline tree (the merge ref's first parent) | |
| id: base | |
| if: github.event_name == 'pull_request' | |
| run: | | |
| set -euo pipefail | |
| BASE_SHA=$(git rev-parse HEAD^1) | |
| git worktree add ../base "$BASE_SHA" | |
| echo "sha=$BASE_SHA" >> "$GITHUB_OUTPUT" | |
| echo "baseline: $BASE_SHA" | |
| - uses: arduino/setup-arduino-cli@v2 | |
| - name: Cache the esp32 arduino core | |
| uses: actions/cache@v4 | |
| with: | |
| path: ~/.arduino15 | |
| key: arduino15-esp32-${{ env.ESP32_CORE }} | |
| - name: Install the esp32 arduino core | |
| # --overwrite: a warm ~/.arduino15 cache already contains the config | |
| # file from the run that saved it, and a plain `config init` hard-fails | |
| # on it (bit the second build of PR #830). | |
| run: | | |
| arduino-cli config init --overwrite --additional-urls https://espressif.github.io/arduino-esp32/package_esp32_index.json | |
| arduino-cli core update-index | |
| arduino-cli core install esp32:esp32@${{ env.ESP32_CORE }} | |
| - name: Build LoadTestChord against this PR's AMY (and the baseline) | |
| # -O2 forced for the same reason as sweep.py: comparable numbers no | |
| # matter what optimize pragma the tree carries. Both builds use the | |
| # PR's copy of the sketch (the test fixture) — only the AMY library | |
| # differs. | |
| run: | | |
| set -euo pipefail | |
| arduino-cli compile --fqbn esp32:esp32:amyboard \ | |
| --library "$PWD" \ | |
| --build-property compiler.optimization_flags=-O2 \ | |
| --build-property "compiler.c.extra_flags=-DARDUINO_SPEEDTEST" \ | |
| --build-path "$PWD/build" \ | |
| tools/arduino_loadsweep/LoadTestChord | |
| if [ -d ../base ]; then | |
| arduino-cli compile --fqbn esp32:esp32:amyboard \ | |
| --library "$(cd ../base && pwd)" \ | |
| --build-property compiler.optimization_flags=-O2 \ | |
| --build-property "compiler.c.extra_flags=-DARDUINO_SPEEDTEST" \ | |
| --build-path "$PWD/build-base" \ | |
| tools/arduino_loadsweep/LoadTestChord | |
| fi | |
| - name: Assemble the firmware artifact | |
| # Everything measure.py needs to flash, self-contained: the three | |
| # sketch bins plus the core's boot_app0.bin (the bench has esptool but | |
| # no arduino core), and ctx.json telling the bench which PR to comment | |
| # on. PR bins live at fw/ top level, the merge-base build under | |
| # fw/base/ — each dir is a complete measure.py build_dir. | |
| run: | | |
| set -euo pipefail | |
| mkdir fw | |
| BOOT_APP0="$(ls ~/.arduino15/packages/esp32/hardware/esp32/*/tools/partitions/boot_app0.bin | tail -1)" | |
| cp build/*.ino.bin build/*.ino.bootloader.bin build/*.ino.partitions.bin "$BOOT_APP0" fw/ | |
| if [ -d build-base ]; then | |
| mkdir fw/base | |
| cp build-base/*.ino.bin build-base/*.ino.bootloader.bin build-base/*.ino.partitions.bin "$BOOT_APP0" fw/base/ | |
| fi | |
| echo '{"pr": ${{ github.event.pull_request.number || 0 }}, "sha": "${{ github.event.pull_request.head.sha || github.sha }}", "base_sha": "${{ steps.base.outputs.sha }}"}' > fw/ctx.json | |
| ls -lR fw | |
| - uses: actions/upload-artifact@v4 | |
| with: | |
| name: amy-hwci-fw | |
| path: fw | |
| retention-days: 7 |