-
Notifications
You must be signed in to change notification settings - Fork 43
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #32 from trombik/esp-idf-master
support esp-idf master, 4.1, and 4.0.1
- Loading branch information
Showing
12 changed files
with
357 additions
and
196 deletions.
There are no files selected for viewing
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,185 @@ | ||
--- | ||
name: Build | ||
on: | ||
- pull_request | ||
- push | ||
jobs: | ||
|
||
# XXX create multiple jobs for major versions | ||
# | ||
# for those who want to _refactor_ the jobs: | ||
# | ||
# in the previous CI implementation, all builds share a single build | ||
# process. that way, you can remove duplications. however, every time a | ||
# version changes the build process, the change affects all other build | ||
# processes. I am tired of tracking changes and workarounds in the build | ||
# process. the result is many `if`s. assuming major version does not change | ||
# (a lot) its build process, creating multiple jobs, and using matrix is the | ||
# only sane way. as GitHub Actions does not support reusable steps, there | ||
# are many duplications. but no need to modify the entire build process to | ||
# adopt changes in master. | ||
build_esp32_v4_x: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
build_method: | ||
- idf | ||
- make | ||
branch: | ||
- master | ||
- v4.1 | ||
- v4.0.1 | ||
steps: | ||
- name: Checkout | ||
uses: actions/checkout@v2 | ||
with: | ||
submodules: true | ||
|
||
- name: Install python | ||
uses: actions/setup-python@v2 | ||
with: | ||
|
||
# XXX install python 3.8 because the official python package | ||
# segfaults when installing modules in the runner. | ||
# | ||
# 2020-09-03T02:29:58.2517141Z Successfully installed cffi-1.14.2 cryptography-3.1 future-0.18.2 pycparser-2.20 pyparsing-2.3.1 pyserial-3.4 setuptools-50.1.0 six-1.15.0 | ||
# 2020-09-03T02:30:09.0409148Z /home/runner/work/_temp/66c91304-eef8-456d-84a1-7299428a62f7.sh: line 5: 4140 Segmentation fault (core dumped) python3 -m pip install --user -r ${IDF_PATH}/requirements.txt | ||
# 2020-09-03T02:30:09.0414254Z ##[error]Process completed with exit code 139. | ||
# | ||
# possibly related issue: | ||
# https://github.com/actions/virtual-environments/issues/159 | ||
python-version: 3.8 | ||
|
||
- name: Install dependencies | ||
run: | | ||
sudo apt-get install \ | ||
bison \ | ||
ccache \ | ||
flex \ | ||
gcc \ | ||
git \ | ||
gperf \ | ||
libffi-dev \ | ||
libncurses-dev \ | ||
libssl-dev \ | ||
make \ | ||
wget | ||
- name: Set environment variables | ||
id: set_env | ||
run: | | ||
SDK_NAME="esp-idf" | ||
GCC_PREFIX="xtensa-esp32-elf" | ||
GCC_FILE="${GCC_PREFIX}-gcc" | ||
# /home/runner/.espressif/tools/xtensa-esp32-elf/esp-2020r2-8.2.0/xtensa-esp32-elf/bin | ||
TOOLCHAIN_DIR="${HOME}/.espressif/tools" | ||
case "${{ matrix.branch }}" in | ||
v4.0.1) | ||
TOOLCHAIN_VERSION="esp-2019r2-8.2.0" | ||
;; | ||
v4.1*) | ||
TOOLCHAIN_VERSION="esp-2020r2-8.2.0" | ||
;; | ||
master) | ||
TOOLCHAIN_VERSION="esp-2020r3-8.4.0" | ||
;; | ||
esac | ||
REPO_DIR=`pwd` | ||
EXAMPLE_DIR="${REPO_DIR}" | ||
DISTFILE_DIR="${HOME}/distfiles" | ||
__PROJECT_PATH=`pwd` | ||
# XXX actions/checkout does not allow to checkout a repository other | ||
# than under __PROJECT_PATH | ||
IDF_PATH="${__PROJECT_PATH}/idf" | ||
echo "::set-env name=IDF_PATH::${IDF_PATH}" | ||
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution | ||
echo "::set-env name=__PROJECT_EXAMPLE_DIR::${EXAMPLE_DIR}" | ||
echo "::set-env name=__PROJECT_GCC_FILE::${GCC_FILE}" | ||
echo "::set-env name=__PROJECT_GCC_PREFIX::${GCC_PREFIX}" | ||
echo "::set-env name=__PROJECT_SDK_NAME::${SDK_NAME}" | ||
echo "::set-env name=__PROJECT_TOOLCHAIN_FILE::${TOOLCHAIN_FILE}" | ||
echo "::set-env name=__PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}" | ||
echo "::set-env name=__PROJECT_TOOLCHAIN_VERSION::${TOOLCHAIN_VERSION}" | ||
echo "::set-env name=__PROJECT_DISTFILE_DIR::${DISTFILE_DIR}" | ||
echo "::set-env name=__PROJECT_PATH::${__PROJECT_PATH}" | ||
echo "::set-env name=__PROJECT_BUILD_COMMAND::${__PROJECT_BUILD_COMMAND}" | ||
echo "::set-env name=__PROJECT_BUILD_COMMAND_ARG::${__PROJECT_BUILD_COMMAND_ARG}" | ||
- name: Checkout the SDK | ||
uses: actions/checkout@v2 | ||
with: | ||
repository: espressif/esp-idf | ||
path: idf | ||
submodules: recursive | ||
ref: ${{ matrix.branch }} | ||
|
||
- name: Fixup the SDK | ||
run: | | ||
# XXX workaround removed option, --no-site-packages, from virtualenv. should | ||
# be removed when the following commit is merged | ||
# https://github.com/espressif/esp-idf/commit/7a18f02acd7005f7c56e62175a8d1968a1a9019d | ||
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py | ||
# XXX remove some modules | ||
# gdbgui cannot be installed successfully with python 3.8 | ||
sed -i -e "s/^gdbgui.*//" -e "s/^pygdbmi.*//" ${IDF_PATH}/requirements.txt | ||
- name: Install python requirements | ||
run: | | ||
cd "${IDF_PATH}" | ||
./install.sh | ||
- name: Compress HTML assets | ||
run: | | ||
cd main/www | ||
bash ./compress_pages.sh | ||
- name: Build (idf.py) | ||
if: ${{ matrix.build_method == 'idf' }} | ||
run: | | ||
IGNORE_FILE="travis-ignore" | ||
. ${IDF_PATH}/export.sh | ||
# XXX share cache between examples. | ||
# see "Compiling In Different Directories" in ccache(1) | ||
# | | 4.0.1 | master | | ||
# |----------------------------------------|---------|---------| | ||
# | without ccache | 33m 42s | 50m 27s | | ||
# | CCACHE_BASEDIR and CCACHE_NOHASHDIR | 10m 41s | 16m 38s | | ||
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}" | ||
export CCACHE_NOHASHDIR=true | ||
cd "${__PROJECT_EXAMPLE_DIR}" | ||
idf.py --ccache build | ||
- name: Setup ccache (make) | ||
|
||
# XXX ccache needs to be configured here | ||
# unlike idf.py, esp-idf does nothing to setup ccache for make. | ||
# IDF_CCACHE_ENABLE does not work either. | ||
if: ${{ matrix.build_method == 'make' }} | ||
run: | | ||
ccache --version | ||
GCC_BIN_DIR="${__PROJECT_TOOLCHAIN_DIR}/${__PROJECT_GCC_PREFIX}/${__PROJECT_TOOLCHAIN_VERSION}/${__PROJECT_GCC_PREFIX}/bin" | ||
CCACHE_BIN_DIR="${HOME}/ccache_bin" | ||
mkdir -p "${CCACHE_BIN_DIR}" | ||
(cd "${CCACHE_BIN_DIR}" && ln -s /usr/bin/ccache "${__PROJECT_GCC_FILE}") | ||
export PATH="${CCACHE_BIN_DIR}:$PATH:${GCC_BIN_DIR}" | ||
${CCACHE_BIN_DIR}/${__PROJECT_GCC_FILE} --version | ||
echo "::set-env name=PATH::${PATH}" | ||
echo "::set-env name=CCACHE_BASEDIR::${__PROJECT_EXAMPLE_DIR}" | ||
echo "::set-env name=CCACHE_NOHASHDIR::true" | ||
- name: Build (make) | ||
if: ${{ matrix.build_method == 'make' }} | ||
run: | | ||
export TERM="xterm-256color" | ||
IGNORE_FILE="travis-ignore" | ||
. ${IDF_PATH}/export.sh | ||
make -C "${__PROJECT_EXAMPLE_DIR}" defconfig | ||
make -C "${__PROJECT_EXAMPLE_DIR}" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -4,3 +4,4 @@ sdkconfig.old | |
.DS_Store | ||
.vscode | ||
main/www/.idea/ | ||
*.swp |
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,21 @@ | ||
set(COMPONENT_SRCS | ||
"app_main.c" | ||
"app_settings.c" | ||
"app_illuminator.c" | ||
"app_camera.c" | ||
"app_wifi.c" | ||
"app_fonts.c" | ||
"app_httpd.c" | ||
"app_lcd.c" | ||
"app_sntp.c" | ||
idf_component_register( | ||
SRCS "app_main.c" | ||
"app_settings.c" | ||
"app_illuminator.c" | ||
"app_camera.c" | ||
"app_wifi.c" | ||
"app_fonts.c" | ||
"app_httpd.c" | ||
"app_lcd.c" | ||
"app_sntp.c" | ||
REQUIRES esp32-camera | ||
esp-idf-ssd1306 | ||
mdns | ||
nvs_flash | ||
esp_http_server | ||
INCLUDE_DIRS "include" | ||
"fonts" | ||
EMBED_FILES "www/index.html.gz" | ||
"www/style.css.gz" | ||
"www/script.js.gz" | ||
) | ||
|
||
set(COMPONENT_ADD_INCLUDEDIRS "include" "fonts") | ||
|
||
set(COMPONENT_REQUIRES | ||
esp32-camera | ||
esp-idf-ssd1306 | ||
mdns | ||
nvs_flash | ||
esp_http_server | ||
) | ||
|
||
set(COMPONENT_EMBED_FILES | ||
"www/index.html.gz" | ||
"www/style.css.gz" | ||
"www/script.js.gz" | ||
) | ||
|
||
register_component() |
Oops, something went wrong.