Skip to content

feat: add ESP32 framework API and VMBC boot chain #22

feat: add ESP32 framework API and VMBC boot chain

feat: add ESP32 framework API and VMBC boot chain #22

Workflow file for this run

name: CI
on:
push:
pull_request:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
host:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: app
- uses: dtolnay/rust-toolchain@1.94.1
with:
components: clippy, rustfmt
- name: Format
run: cargo fmt --all -- --check
working-directory: app
- name: Clippy
run: cargo clippy --all-targets -- -D warnings
working-directory: app
- name: Test host runner
run: cargo test --all-targets
working-directory: app
- name: Test embedded host-function ABI
run: cargo test --features esp32
working-directory: app
- name: Test VMBC partition packer
run: |
python scripts/flash_vmbc.py programs/esp32-blinky.rss --output /tmp/rustscript.partition.bin
test -s /tmp/rustscript.partition.bin
working-directory: app
- name: Examples smoke
run: |
cargo run --example run_file -- programs/blinky.rss | grep 'led:off'
printf 'print(1 + 2);\n.quit\n' | cargo run --example repl | grep '3'
working-directory: app
esp32:
name: ESP32-C3 factory firmware
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
path: app
- uses: dtolnay/rust-toolchain@1.94.1
with:
components: llvm-tools-preview
targets: riscv32imc-unknown-none-elf
- uses: actions/setup-python@v5
with:
python-version: "3.12"
- name: Install PlatformIO
run: python -m pip install platformio==6.1.19
- name: Build complete firmware
run: pio run
working-directory: app
- name: Verify firmware artifacts
run: |
test -s .pio/build/esp32-c3-devkitm-1/firmware.elf
test -s .pio/build/esp32-c3-devkitm-1/firmware.bin
test -s dist/micro-rustscript-esp32-c3.factory.bin
test -s .pio/generated/rustscript.partition.bin
nm -C .pio/build/esp32-c3-devkitm-1/firmware.elf | grep rustscript_run_vmbc
nm -C .pio/build/esp32-c3-devkitm-1/firmware.elf | grep rustscript_dispatch_host
grep 'rustscript.*0x210000.*0x100000' partitions.csv
stat --format='%n %s bytes' \
.pio/build/esp32-c3-devkitm-1/firmware.elf \
.pio/build/esp32-c3-devkitm-1/firmware.bin \
dist/micro-rustscript-esp32-c3.factory.bin \
.pio/generated/esp32-blinky.vmbc \
.pio/generated/rustscript.partition.bin
working-directory: app
- uses: actions/upload-artifact@v4
with:
name: micro-rustscript-esp32-c3
path: |
app/dist/micro-rustscript-esp32-c3.factory.bin
app/.pio/build/esp32-c3-devkitm-1/firmware.elf
app/.pio/generated/esp32-blinky.vmbc
app/.pio/generated/rustscript.partition.bin
app/scripts/flash_vmbc.py
app/scripts/vmbc_image.py
app/scripts/repl_vmbc.py
app/partitions.csv