Skip to content

ESP32 C3 test

ESP32 C3 test #21

name: ESP32 C3 test
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
on:
workflow_dispatch:
jobs:
tensorflow_micropython_esp32_c3_build:
runs-on: ubuntu-latest
strategy:
matrix:
idf-version: [4.4.1, 4.4.2, 4.4.3, 4.4.4, 4.4.5, 4.4.6, 4.4.7]
steps:
- name: Checkout repository
uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3.10'
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32
run: |
git submodule init
git submodule update --recursive
cd micropython
git submodule update --init lib/axtls
git submodule update --init lib/berkeley-db-1.xx
cd ports/esp32
make BOARD= submodules
cd ../../..
cd tflm_esp_kernels
git submodule update --init components/esp32-camera
git submodule update --init components/esp-nn
- name: Get Cache Keys
# later get this like this: git ls-remote --heads https://github.com/espressif/esp-idf
# this commit is hard-coded in micropython/tools/ci.sh
run: |
IDF_COMMIT=142bb32c50fa9875b8b69fa539a2d59559460d72
echo "esp-idf-commit=$IDF_COMMIT" >> $GITHUB_ENV
TFLM_COMMIT=$(git submodule status tensorflow | awk '{print ($1)}')
echo "tflm-commit=$TFLM_COMMIT" >> $GITHUB_ENV
# - name: Cache esp-idf
# id: cache-esp-idf
# uses: actions/cache@v2
# env:
# cache-name: cache-esp-idf
# with:
# path: ./esp-idf
# key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.esp-idf-commit }}
- name: Copy change-files
run: |
echo "Copying change-files"
cp -r change-files/micropython ./
- name: Setup IDF
# if: steps.cache-esp-idf.outputs.cache-hit != 'true'
run: |
source ./micropython/tools/ci.sh && ci_esp32_setup_helper v${{ matrix.idf-version }}
- name: Cache tflm
id: cache-tflm
uses: actions/cache@v4
env:
cache-name: cache-tflm
with:
path: ./micropython-modules/microlite/tflm
key: ${{ runner.os }}-build-${{ env.cache-name }}-${{ env.tflm-commit }}
- name: Setup Build for Tensorflow
# if: steps.cache-tflm.outputs.cache-hit != 'true'
run: |
source ./esp-idf/export.sh
# pip3 install wheel mysqlclient
pip3 install Pillow
# pip3 install Wave
echo "Regenerating microlite/tfm directory"
rm -rf ./micropython-modules/microlite/tflm
cd ./tensorflow
../micropython-modules/microlite/prepare-tflm-esp.sh
- name: Build micropython cross compiler
run: |
source ./esp-idf/export.sh
cd ./micropython
echo "make -C mpy-cross V=1 clean all"
make -C mpy-cross V=1 clean all
- name: Build ESP32-MICROLITE_C3_USB
run: |
source ./esp-idf/export.sh
echo "cd ./boards/esp32/MICROLITE_C3_USB"
cd ./boards/esp32/MICROLITE_C3_USB
echo "Building ESP32 MICROLITE_C3_USB"
rm -rf builds
idf.py clean build
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
../../../micropython/ports/esp32
- name: Archive ESP32-MICROLITE_C3_USB firmware
uses: actions/upload-artifact@v4
with:
name: microlite-esp32c3-usb-firmware-${{ matrix.idf-version }}
path: |
boards/esp32/MICROLITE_C3_USB/build/firmware.bin