ESP32-H2 support #32
Workflow file for this run
This file contains 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: 'build' | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
jobs: | |
build: | |
runs-on: ubuntu-22.04 | |
strategy: | |
matrix: | |
include: | |
- example: "blink" | |
expected_size: 7436 | |
- example: "hello_world" | |
expected_size: 10216 | |
steps: | |
- uses: actions/checkout@v2 | |
- name: Build for ESP32-C3 | |
shell: bash | |
run: | | |
export TOOLCHAIN_VERSION="12.2.0-3" | |
export TOOLCHAIN_DIR="xpack-riscv-none-elf-gcc-${TOOLCHAIN_VERSION}" | |
export TOOLCHAIN_ARCHIVE="${TOOLCHAIN_DIR}-linux-x64.tar.gz" | |
export TOOLCHAIN_URL="https://github.com/xpack-dev-tools/riscv-none-elf-gcc-xpack/releases/download/v${TOOLCHAIN_VERSION}/${TOOLCHAIN_ARCHIVE}" | |
wget --no-verbose ${TOOLCHAIN_URL} | |
tar xf ${TOOLCHAIN_ARCHIVE} | |
export PATH=$PWD/${TOOLCHAIN_DIR}/bin:$PATH | |
cd examples/${{ matrix.example }} | |
mkdir -p build | |
cmake -S . -B build | |
cmake --build build | |
bin_size=$(stat --format="%s" build/${{ matrix.example }}.bin) | |
expected_size=${{ matrix.expected_size }} | |
size_tolerance=500 | |
echo "Binary size for ${{ matrix.example }} example: ${bin_size}, expected: ${expected_size}" | |
test ${bin_size} -gt $(($expected_size - $size_tolerance)) || (echo "binary seems too small"; exit 1) | |
test ${bin_size} -lt $(($expected_size + $size_tolerance)) || (echo "binary seems too large"; exit 1) |