forked from mocleiri/tensorflow-micropython-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
171 lines (137 loc) · 5.51 KB
/
build_esp32s3.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
name: ESP32 S3
# https://docs.github.com/en/actions/reference/workflow-syntax-for-github-actions#onschedule
on:
push:
pull_request:
paths-ignore:
- 'examples/**'
- 'README.md'
- 'ci/*unix*.sh'
- '.github/workflows/build_unix.yml'
jobs:
tensorflow_micropython_esp32_s3_build:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v2
- 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=5bb59b00e72f8f91eb24d8c65bf9a7ea2b8a4f5f
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: Setup IDF
# if: steps.cache-esp-idf.outputs.cache-hit != 'true'
run: |
source ./micropython/tools/ci.sh && ci_esp32_idf44_setup
- name: Cache tflm
id: cache-tflm
uses: actions/cache@v2
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 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 standard non-ps ram ESP32 S3 8MB FLASH
run: |
source ./esp-idf/export.sh
echo "cd ./boards/esp32/MICROLITE_S3"
cd ./boards/esp32/MICROLITE_S3
echo "Building ESP32-MICROLITE_S3"
rm -rf builds
idf.py clean build
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
../../../micropython/ports/esp32
- name: Archive ESP32-MICROLITE_S3 firmware
uses: actions/[email protected]
with:
name: microlite-esp32s3-firmware
path: |
boards/esp32/MICROLITE_S3/build/firmware.bin
- name: Build ESP32 S3 psram support and 8MB Flash firmware
run: |
source ./esp-idf/export.sh
echo "cd ./boards/esp32/MICROLITE_S3_SPIRAM"
cd ./boards/esp32/MICROLITE_S3_SPIRAM
echo "Building ESP32-MICROLITE_S3_SPIRAM"
rm -rf builds
idf.py clean build
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
../../../micropython/ports/esp32
- name: Archive ESP32-MICROLITE_S3_SPIRAM firmware
uses: actions/[email protected]
with:
name: microlite-esp32s3-spiram-firmware
path: |
boards/esp32/MICROLITE_S3_SPIRAM/build/firmware.bin
- name: Build ESP32 S3 psram support and 8MB Flash firmware - spiram cs gpio 20
run: |
source ./esp-idf/export.sh
echo "cd ./boards/esp32/MICROLITE_S3_SPIRAM_CS_GPIO_20"
cd ./boards/esp32/MICROLITE_S3_SPIRAM_CS_GPIO_20
echo "Building ESP32-MICROLITE_S3_SPIRAM_CS_GPIO_20"
rm -rf builds
idf.py clean build
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
../../../micropython/ports/esp32
- name: Archive ESP32-MICROLITE_S3_SPIRAM_CS_GPIO_20 firmware
uses: actions/[email protected]
with:
name: microlite-esp32-s3-spiram-cs-gpio-20-firmware
path: |
boards/esp32/MICROLITE_S3_SPIRAM_CS_GPIO_20/build/firmware.bin
- name: Build ESP32 S3 psram support and 8MB Flash firmware - OCTAL SPIRAM
run: |
source ./esp-idf/export.sh
echo "cd ./boards/esp32/MICROLITE_S3_SPIRAM_OCTAL"
cd ./boards/esp32/MICROLITE_S3_SPIRAM_OCTAL
echo "Building ESP32-MICROLITE_S3_SPIRAM_OCTAL"
rm -rf builds
idf.py clean build
../../../micropython-modules/microlite/assemble-unified-image-esp.sh \
../../../micropython/ports/esp32
- name: Archive ESP32-MICROLITE_S3_SPIRAM_OCTAL firmware
uses: actions/[email protected]
with:
name: microlite-esp32-s3-spiram-octal-firmware
path: |
boards/esp32/MICROLITE_S3_SPIRAM_OCTAL/build/firmware.bin