Add compilation to espressif (#5947)

* Refactor GitHub actions and add ESP tests.
* Add script for building all examples for ESP.
* Fixes for ESP-IDF v5.0
* Consolidating Espressif files into a single include.am
Co-authored-by: Andras Fekete <andras@wolfssl.com>
pull/5939/head
András Fekete 2023-01-03 12:50:38 -05:00 committed by GitHub
parent bdcf6928a2
commit 4f8edb312b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
10 changed files with 137 additions and 98 deletions

View File

@ -0,0 +1,38 @@
name: Test Espressif examples on various official Docker containers
concurrency:
group: ${{ github.ref }}
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
espressif_latest:
name: Test Espressif on latest Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:latest
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v4_4:
name: Test Espressif on v4.4 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v4.4
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh
espressif_v5_0:
name: Test Espressif on v5.0 Docker container
runs-on: ubuntu-latest
container:
image: espressif/idf:release-v5.0
steps:
- uses: actions/checkout@v3
- name: Initialize Espressif IDE and build examples
run: . /opt/esp/idf/export.sh; IDE/Espressif/ESP-IDF/compileAllExamples.sh

View File

@ -1,28 +0,0 @@
name: macOS Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: brew
run: brew install automake libtool
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

73
.github/workflows/os-check.yml vendored 100644
View File

@ -0,0 +1,73 @@
name: Test MacOS/Ubuntu/Windows compilation
concurrency:
group: ${{ github.ref }}
on:
push:
branches: [ 'master', 'main', 'release/**' ]
pull_request:
branches: [ '*' ]
jobs:
macos_build:
name: macOS Build Test
runs-on: macos-latest
steps:
- uses: actions/checkout@v2
- name: brew
run: brew install automake libtool
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck
ubuntu_build:
name: Ubuntu Build Test
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck
windows_build:
name: Windows Build Test
runs-on: windows-latest
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolfssl64.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

View File

@ -1,26 +0,0 @@
name: Ubuntu Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: autogen
run: ./autogen.sh
- name: configure
run: ./configure
- name: make
run: make
- name: make check
run: make check
- name: make distcheck
run: make distcheck

View File

@ -1,38 +0,0 @@
name: Windows Build Test
on:
push:
branches: [ '*' ]
pull_request:
branches: [ '*' ]
env:
# Path to the solution file relative to the root of the project.
SOLUTION_FILE_PATH: wolfssl64.sln
# Configuration type to build.
# You can convert this to a build matrix if you need coverage of multiple configuration types.
# https://docs.github.com/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix
BUILD_CONFIGURATION: Release
BUILD_PLATFORM: x64
jobs:
build:
runs-on: windows-latest
steps:
- uses: actions/checkout@v2
- name: Add MSBuild to PATH
uses: microsoft/setup-msbuild@v1
- name: Restore NuGet packages
working-directory: ${{env.GITHUB_WORKSPACE}}
run: nuget restore ${{env.SOLUTION_FILE_PATH}}
- name: Build
working-directory: ${{env.GITHUB_WORKSPACE}}
# Add additional options to the MSBuild command line here (like platform or verbosity level).
# See https://docs.microsoft.com/visualstudio/msbuild/msbuild-command-line-reference
run: msbuild /m /p:PlatformToolset=v142 /p:Platform=${{env.BUILD_PLATFORM}} /p:Configuration=${{env.BUILD_CONFIGURATION}} ${{env.SOLUTION_FILE_PATH}}

View File

@ -0,0 +1,14 @@
#!/bin/bash
# Example usage:
# cd wolfssl && docker run --rm -v $PWD:/project -w /project espressif/idf:latest IDE/Espressif/ESP-IDF/compileAllExamples.sh
SCRIPT_DIR=$(builtin cd ${BASH_SOURCE%/*}; pwd)
pushd ${SCRIPT_DIR} && ./setup.sh; popd
for file in "benchmark" "client" "server" "test"; do
cd ${IDF_PATH}/examples/protocols/wolfssl_${file}/ && idf.py build
if [ $? -ne 0 ]; then
echo "Failed in ${file}"
exit 1
fi
done

View File

@ -132,8 +132,8 @@ void app_main(void)
ESP_ERROR_CHECK(nvs_flash_init());
ESP_LOGI(TAG, "Initialize wifi");
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR > 5)
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR >= 5)
esp_netif_init();
#else
tcpip_adapter_init();

View File

@ -133,8 +133,8 @@ void app_main(void)
ESP_LOGI(TAG, "Initialize wifi");
/* TCP/IP adapter initialization */
#if (ESP_IDF_VERSION_MAJOR >= 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR > 5)
#if (ESP_IDF_VERSION_MAJOR == 4 && ESP_IDF_VERSION_MINOR >= 1) || \
(ESP_IDF_VERSION_MAJOR >= 5)
esp_netif_init();
#else
tcpip_adapter_init();

View File

@ -0,0 +1,7 @@
# vim:ft=automake
# included from Top Level Makefile.am
# All paths should be given relative to the root
EXTRA_DIST+= IDE/Espressif/ESP-IDF/setup_win.bat
EXTRA_DIST+= IDE/Espressif/ESP-IDF/dummy_test_paths.h
EXTRA_DIST+= IDE/Espressif/ESP-IDF/compileAllExamples.sh

View File

@ -50,8 +50,7 @@ include IDE/IAR-MSP430/include.am
include IDE/zephyr/include.am
include IDE/AURIX/include.am
include IDE/MCUEXPRESSO/include.am
include IDE/Espressif/include.am
EXTRA_DIST+= IDE/IAR-EWARM IDE/MDK-ARM IDE/MDK5-ARM IDE/MYSQL IDE/LPCXPRESSO IDE/HEXIWEAR IDE/Espressif
EXTRA_DIST+= IDE/OPENSTM32/README.md
EXTRA_DIST+= IDE/Espressif/ESP-IDF/setup_win.bat
EXTRA_DIST+= IDE/Espressif/ESP-IDF/dummy_test_paths.h