Skip to content

Commit fa7e487

Browse files
committed
Use helper script in CI
1 parent e6b3215 commit fa7e487

File tree

3 files changed

+8
-33
lines changed

3 files changed

+8
-33
lines changed

.github/workflows/build_boards.yml

Lines changed: 2 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -39,44 +39,14 @@ jobs:
3939
- name: Checkout repository
4040
uses: actions/checkout@v2
4141

42-
- name: Prepare to Build Tensorflow Micropython Firmware for ESP32
43-
run: |
44-
git submodule init
45-
git submodule update --recursive
46-
cd third_party/micropython
47-
git submodule update --init lib/axtls
48-
git submodule update --init lib/berkeley-db-1.xx
49-
cd ports/esp32
50-
make BOARD= submodules
51-
cd ../../../
52-
5342
- name: Setup Python
5443
uses: actions/setup-python@v5
5544
with:
5645
python-version: 3.10.16
5746

58-
- name: Setup IDF
59-
run: |
60-
source ./third_party/micropython/tools/ci.sh && ci_esp32_idf_setup
61-
62-
- name: Setup Build for Tensorflow
63-
run: |
64-
source ./esp-idf/export.sh
65-
pip3 install Pillow numpy Wave
66-
67-
- name: Build micropython cross compiler
68-
run: |
69-
source ./esp-idf/export.sh
70-
cd ./third_party/micropython
71-
make -C mpy-cross V=1 clean all
72-
73-
- name: Build Firmware
47+
- name: Build firmware using helper script
7448
run: |
75-
source ./esp-idf/export.sh
76-
cd ./boards/${{ matrix.board_type }}
77-
rm -rf build
78-
idf.py clean build
79-
chmod +x ../../scripts/assemble-unified-image-esp.sh
49+
./scripts/build_and_check.sh ${{ matrix.board_type }}
8050
8151
- name: Archive Firmware
8252
uses: actions/upload-artifact@v4

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,3 +23,5 @@ A helper script `scripts/build_and_check.sh` can be used to build the firmware f
2323
```
2424

2525
The script expects the submodules to be accessible over the network in order to fetch Micropython and related dependencies.
26+
27+
This helper script is also invoked by the continuous integration workflow to build firmware artifacts automatically.

scripts/build_and_check.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,13 +29,16 @@ fi
2929
# Source esp-idf environment
3030
source ./esp-idf/export.sh
3131

32+
# Install Python packages required for the build
33+
pip3 install Pillow numpy Wave
34+
3235
# Build micropython cross compiler
3336
pushd third_party/micropython >/dev/null
3437
make -C mpy-cross V=1 clean all
3538
popd >/dev/null
3639

3740
# Build firmware for the selected board
38-
pushd boards/${BOARD} >/dev/null
41+
pushd "boards/${BOARD}" >/dev/null
3942
rm -rf build
4043
idf.py clean build
4144
chmod +x ../../scripts/assemble-unified-image-esp.sh

0 commit comments

Comments
 (0)