name: ESP32-P4 build # Compile+link smoke test for contrib/esp32p4/chd/chd_esp_vfs.{h,c} - the # stdio-FILE*-backed core_file_callbacks bridge for ESP32-P4 firmware (see # contrib/esp32p4/README.md). Proves it builds and fully links against # libchdr, catching header/ABI mismatches between the two. # # Uses the same generic riscv64-unknown-elf-gcc (rv32imafc/ilp32f) toolchain # as rv32-ram-budget.yml/cmake/toolchain-rv32imafc.cmake, not Espressif's own # riscv32-esp-elf toolchain or ESP-IDF - there is no pinned open-source # ESP32-P4 firmware project to build+link against the way # bl616-tangcore-build.yml does for BL616 against nand2mario's firmware-bl616, # so this only proves the RV32IMAFC/ilp32f ABI ESP32-P4's RISC-V cores share # with BL616 links cleanly, not that it builds under the real ESP-IDF build # system. No ESP32-P4 hardware in CI either way, so this can't prove # chd_open()/chd_read() work at runtime - see smoke_test.c. on: # push only on master: a branch push and its pull request otherwise run # every job twice on the same commit. paths-ignore skips work the change # cannot affect - the other target's tree is not # built here, and prose does not change decoded output. push: branches: [master] paths-ignore: - 'docs/**' - '**.md' - 'LICENSE' - '.gitignore' - 'contrib/tangcore-bl616/**' pull_request: paths-ignore: - 'docs/**' - '**.md' - 'LICENSE' - '.gitignore' - 'contrib/tangcore-bl616/**' # Cancel superseded runs: a force-push otherwise leaves the previous commit's # jobs running to completion alongside the new ones. Never cancels master. concurrency: group: ${{ github.workflow }}-${{ github.ref }} cancel-in-progress: ${{ github.ref != 'refs/heads/master' }} jobs: esp32p4-build: runs-on: ubuntu-latest # Cap a wedged runner. The slowest legitimate job here finishes well # inside this; without it a VM that fails to boot runs to GitHub's # six-hour maximum, which has happened. timeout-minutes: 15 steps: - uses: actions/checkout@v7 - name: Install RV32 toolchain run: | sudo apt-get update -qq sudo apt-get install -y --no-install-recommends \ gcc-riscv64-unknown-elf picolibc-riscv64-unknown-elf \ binutils-riscv64-unknown-elf - name: Configure (rv32imafc/ilp32f) run: > cmake -B build-esp32p4 -DCMAKE_TOOLCHAIN_FILE=${{github.workspace}}/cmake/toolchain-rv32imafc.cmake -DBUILD_SHARED_LIBS=OFF -DINSTALL_STATIC_LIBS=OFF -DCMAKE_BUILD_TYPE=MinSizeRel -DCHDR_LOWRAM_TARGET=ON -DCHDR_WANT_TESTS=OFF - name: Build chdr-static run: cmake --build build-esp32p4 --target chdr-static -j$(nproc) - name: Build + link smoke test run: | riscv64-unknown-elf-gcc -march=rv32imafc -mabi=ilp32f \ --specs=picolibc.specs --crt0=semihost --oslib=semihost \ -I include -I contrib/esp32p4 -Os -flto \ -o contrib/esp32p4/smoke_test.elf \ contrib/esp32p4/smoke_test.c contrib/esp32p4/chd/chd_esp_vfs.c \ build-esp32p4/libchdr-static.a \ build-esp32p4/deps/lzma-26.02/libchdr-lzma.a \ build-esp32p4/deps/zstd-1.5.7/libzstd.a \ build-esp32p4/deps/miniz-3.1.2/libminiz.a riscv64-unknown-elf-size contrib/esp32p4/smoke_test.elf