Skip to content

Merge pull request #45 from jefftharris/fix/tcp-crash #1

Merge pull request #45 from jefftharris/fix/tcp-crash

Merge pull request #45 from jefftharris/fix/tcp-crash #1

Workflow file for this run

---
name: Build examples
on:
push:
pull_request:
branches:
- main
# include workflow_dispatch to enable manual trigger from Web UI.
workflow_dispatch:
jobs:
pre_build:
# A job to see if the entrire jobs should be skipped. each job for a
# target should have:
#
# needs: pre_build
# if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
outputs:
should_skip: ${{ steps.skip_check.outputs.should_skip }}
steps:
- id: skip_check
uses: fkirc/[email protected]
with:
concurrent_skipping: same_content
# if the change includes documentation, or ruby files changes only, skip.
paths_ignore: '["docs/**", "**/*.md", "*.md", "**/*.rb"]'
# but do not skip if the triggered event is one of these.
do_not_skip: '["workflow_dispatch", "schedule", "pull_request"]'
# 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_master:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
target:
- esp32
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- 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-${{ matrix.target }}-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
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 "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_SDK_NAME=${SDK_NAME}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
echo "__PROJECT_DISTFILE_DIR=${DISTFILE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/esp-idf
path: idf
submodules: recursive
ref: master
- 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
- name: Run idf_tools.py install
run: |
${IDF_PATH}/tools/idf_tools.py install
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
run: |
IGNORE_FILE="ci-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}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
idf.py --ccache build
fi
done
build_esp32_v4_x:
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# for supported versions by espressif, see:
# https://docs.espressif.com/projects/esp-idf/en/latest/esp32/versions.html
#
# see issue #2
# - v4.1.2
- v4.2.3
- v4.3.2
- v4.4.1
target:
- esp32
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- 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-${{ matrix.target }}-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
case "${{ matrix.branch }}" in
v4.0.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.1.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.2.*)
TOOLCHAIN_VERSION="esp-2020r3-8.4.0"
;;
v4.3.*)
TOOLCHAIN_VERSION="esp-2021r2-8.4.0"
;;
v4.4.*)
TOOLCHAIN_VERSION="esp-2021r2-patch3-8.4.0"
;;
*)
echo "Unknown matrix.branch: ${{ matrix.branch }}"
exit 1
;;
esac
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
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 "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_SDK_NAME=${SDK_NAME}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_FILE=${TOOLCHAIN_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
echo "__PROJECT_DISTFILE_DIR=${DISTFILE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
- 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
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools
- name: Run idf_tools.py install
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' }}
run: |
${IDF_PATH}/tools/idf_tools.py install
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-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}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
idf.py --ccache build
fi
done
build_esp8266:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
# XXX build examples with make only
# idf.py in ESP8266 RTOS SDK is broken in many ways.
- make
branch:
- v3.4
- master
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
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="ESP8266_RTOS_SDK"
GCC_PREFIX="xtensa-lx106-elf"
GCC_FILE="${GCC_PREFIX}-gcc"
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
__PROJECT_TOOLCHAIN_VERSION="esp-2020r3-49-gd5524c1-8.4.0"
# XXX actions/checkout does not allow to checkout a repository other
# than under __PROJECT_PATH
IDF_PATH="${__PROJECT_PATH}/idf"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
# cache-idf-tools needs PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
# XXX prefix all the environment variables with `__PROJECT_` to avoid pollution
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_FILE=${GCC_FILE}" >> ${GITHUB_ENV}
echo "__PROJECT_GCC_PREFIX=${GCC_PREFIX}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_DIR=${TOOLCHAIN_DIR}" >> ${GITHUB_ENV}
echo "__PROJECT_PATH=${__PROJECT_PATH}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND=${__PROJECT_BUILD_COMMAND}" >> ${GITHUB_ENV}
echo "__PROJECT_BUILD_COMMAND_ARG=${__PROJECT_BUILD_COMMAND_ARG}" >> ${GITHUB_ENV}
echo "__PROJECT_TOOLCHAIN_VERSION=${__PROJECT_TOOLCHAIN_VERSION}" >> ${GITHUB_ENV}
- name: Checkout the SDK
uses: actions/checkout@v2
with:
repository: espressif/ESP8266_RTOS_SDK
path: idf
submodules: recursive
ref: ${{ matrix.branch }}
# XXX git.eclipse.org does not allow to fetch a commit. fetch all
# the commits.
fetch-depth: 0
- name: Install python requirements (pip)
run: |
python -m pip install --user -r ${IDF_PATH}/requirements.txt
- name: Cache toolchain
id: cache-idf-tools
if: ${{ matrix.branch != 'master' }}
uses: actions/cache@v2
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-esp8266-cache-tools
- name: Install toolchain
if: ${{ steps.cache-idf-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Setup ccache (make)
run: |
__PROJECT_CCACHE_BIN_DIR="${HOME}/ccache_bin"
mkdir -p "${__PROJECT_CCACHE_BIN_DIR}"
(cd "${__PROJECT_CCACHE_BIN_DIR}" && ln -s /usr/bin/ccache "${__PROJECT_GCC_FILE}")
echo "PATH=${__PROJECT_CCACHE_BIN_DIR}:$PATH:${__PROJECT_TOOLCHAIN_DIR}/${__PROJECT_GCC_PREFIX}/${__PROJECT_TOOLCHAIN_VERSION}/${__PROJECT_GCC_PREFIX}/bin" >> ${GITHUB_ENV}
echo "CCACHE_BASEDIR=${__PROJECT_EXAMPLE_DIR}" >> ${GITHUB_ENV}
echo "CCACHE_NOHASHDIR=true" >> ${GITHUB_ENV}
- name: Build (make)
if: ${{ matrix.build_method == 'make' }}
run: |
IGNORE_FILE="ci-ignore-esp8266"
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
# XXX ESP8266 RTOS SDK does not support
# `sdkconfig.defaults.TARGET_NAME` yet. create
# sdkconfig.defaults for ESP8266
echo "CONFIG_WIREGUARD_ESP_TCPIP_ADAPTER=y" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
echo "Building ${i}..."
make defconfig
make -j$(nproc)
fi
done
# XXX esp32s2 support was introduced in v4.2. older esp-idf does not install
# toolchains for esp32s2. thus, you cannot add `esp32s2` target to
# build_esp32_v4_x.
#
# this job can be removed when either one of the followings are met:
#
# * GitHub Actions supports "early exit" (successfully exit if a condition is
# true).
# * all branches in build_esp32_v4_x supports esp32s2
#
# additionally, esp32s2 build requires idf.py. make is not supported.
build_esp32s2_v4_x:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# esp32s2 support since v4.2.x
- master
- v4.2.2
- v4.3.1
- v4.4.1
target:
- esp32s2
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
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: |
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
IDF_PATH="${__PROJECT_PATH}/idf"
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
- 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: |
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
if: ${{ matrix.branch != 'master' }}
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools
- name: Run install.sh
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
echo "Building ${i}..."
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
idf.py --ccache build
fi
done
build_esp32c3_v4_x:
runs-on: ubuntu-latest
needs: pre_build
if: ${{ needs.pre_build.outputs.should_skip != 'true' }}
strategy:
fail-fast: false
matrix:
build_method:
- idf
branch:
# esp32c3 support was introduced in v4.3.
- master
- v4.3.2
target:
- esp32c3
ip_version:
- ipv4
- ipv6
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install python
uses: actions/setup-python@v2
with:
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: |
TOOLCHAIN_DIR="${HOME}/.espressif/tools"
REPO_DIR=`pwd`
EXAMPLE_DIR="${REPO_DIR}/examples"
__PROJECT_PATH=`pwd`
IDF_PATH="${__PROJECT_PATH}/idf"
# cache-idf-tools needs __PROJECT_TOOLCHAIN_DIR
echo "::set-output name=PROJECT_TOOLCHAIN_DIR::${TOOLCHAIN_DIR}"
echo "IDF_PATH=${IDF_PATH}" >> ${GITHUB_ENV}
echo "IDF_TARGET=${{ matrix.target }}" >> ${GITHUB_ENV}
echo "__PROJECT_EXAMPLE_DIR=${EXAMPLE_DIR}" >> ${GITHUB_ENV}
- 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: |
sed -i -e "s/'--no-site-packages',//" ${IDF_PATH}/tools/idf_tools.py
- name: Cache esp-idf tools
# cache esp-idf tools. each tagged branch has fixed versions of tools.
# the versions do not change. the master is an exception as it is a
# moving target. do NOT cache tools if the branch is master.
uses: actions/cache@v2
id: cache-tools
if: ${{ matrix.branch != 'master' }}
with:
path: ${{ steps.set_env.outputs.PROJECT_TOOLCHAIN_DIR }}
key: ${{ runner.os }}-${{ matrix.branch }}-${{ matrix.target }}-cache-tools-1
- name: Run install.sh
if: ${{ steps.cache-tools.outputs.cache-hit != 'true' || matrix.branch == 'master' }}
run: |
${IDF_PATH}/install.sh
- name: Run idf_tools.py install-python-env
run: |
${IDF_PATH}/tools/idf_tools.py install-python-env
- name: Build (idf.py)
if: ${{ matrix.build_method == 'idf' }}
run: |
IGNORE_FILE="ci-ignore"
. ${IDF_PATH}/export.sh
export CCACHE_BASEDIR="${__PROJECT_EXAMPLE_DIR}"
export CCACHE_NOHASHDIR=true
cd "${__PROJECT_EXAMPLE_DIR}"
for i in $(ls -d *); do
if [ ! -e "${__PROJECT_EXAMPLE_DIR}/${i}/${IGNORE_FILE}" ]; then
cd "${__PROJECT_EXAMPLE_DIR}/${i}"
echo "Building ${i}..."
# FIXME Remove this workaround when esp-idf issue #7621 will be fixed
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE=n" >> sdkconfig.defaults
echo "CONFIG_MBEDTLS_CERTIFICATE_BUNDLE_DEFAULT_FULL=n" >> sdkconfig.defaults
if [ ${{ matrix.ip_version }} == "ipv6" ]; then
echo "CONFIG_LWIP_IPV6=y" >> sdkconfig.defaults
fi
idf.py --ccache build
fi
done
all_build:
# a meta job that requires all of the above so that repository
# admin can choose a single test name in "Require status checks to pass
# before merging". A trick obtained from:
#
# https://github.com/jazzband/pip-tools/issues/1085#issuecomment-619172509
name: All build
runs-on: ubuntu-latest
needs:
- build_esp32_master
- build_esp32_v4_x
- build_esp8266
- build_esp32s2_v4_x
- build_esp32c3_v4_x
steps:
- name:
run: |
echo "All builds finished"