ci: Run Test App on target

This commit is contained in:
Tomas Rezucha 2022-02-21 11:24:31 +01:00
parent feb0f628a3
commit 2019d71fd4
9 changed files with 76 additions and 15 deletions

View File

@ -6,6 +6,7 @@ on:
jobs:
build:
name: Build Test App
strategy:
matrix:
idf_ver: ["release-v4.3", "release-v4.4", "latest"]
@ -23,14 +24,14 @@ jobs:
env:
IDF_TARGET: ${{ matrix.idf_target }}
shell: bash
working-directory: test_app
run: |
cd test_app
. ${IDF_PATH}/export.sh
idf.py build
- name: Merge binaries
working-directory: test_app/build
run: |
pip install esptool
cd test_app/build
python -m esptool --chip esp32 merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
- uses: actions/upload-artifact@v2
with:
@ -38,18 +39,54 @@ jobs:
path: |
test_app/build/flash_image.bin
run-qemu:
name: Run Test App in QEMU
#run-qemu: # Keeping this here for future reference. QEMU tests are not passing now
# name: Run Test App in QEMU
# needs: build
# strategy:
# matrix:
# idf_ver: ["release-v4.4", "latest"] #FIXME: QEMU is crashing with v4.3 build
# runs-on: ubuntu-20.04
# container: ageon/pytest_env
# steps:
# - uses: actions/checkout@v2
# with:
# fetch-depth: 0
# - uses: actions/download-artifact@v2
# with:
# name: test_app_bin_esp32_${{ matrix.idf_ver }}
# path: test_app/build
# - name: Run Test App in QEMU
# working-directory: test_app
# run: pytest -s --junit-xml=./test_app_results.xml --embedded-services qemu
run-target:
name: Run Test App on target
needs: build
strategy:
matrix:
idf_ver: ["release-v4.3", "release-v4.4", "latest"]
runs-on: ubuntu-20.04
container: ageon/pytest_env
idf_target: ["esp32", "esp32c3", "esp32s3"]
exclude:
- idf_ver: "release-v4.3"
idf_target: esp32s3 # ESP32S3 support started with version 4.4
runs-on: [self-hosted, linux, docker, esp32] # Unfortunately `${{ matrix.idf_target }}` is not accepted here
container:
image: python:3.7-slim-buster
options: --privileged
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/download-artifact@v2
with:
name: test_app_bin_esp32_${{ matrix.idf_ver }}
- name: Display structure of downloaded files
run: ls -R
name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: test_app/build
- name: Install Python packages
env:
PIP_EXTRA_INDEX_URL: "https://www.piwheels.org/simple"
run: pip install esptool pytest-embedded==0.6.0rc0 pytest-embedded-serial-esp==0.6.0rc0
- name: Download Test App to target
run: python -m esptool --chip ${{ matrix.idf_target }} write_flash 0x0 test_app/build/flash_image.bin
- name: Run Test App on target
working-directory: test_app
run: pytest -s --junit-xml=./test_app_results.xml --embedded-services esp --target=${{ matrix.idf_target }}

View File

@ -9,5 +9,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: actions/setup-python@v2
- uses: pre-commit/action@v2.0.3

View File

@ -2,4 +2,4 @@ version: "2.4.3"
description: "Expat - XML Parsing C Library"
url: https://github.com/espressif/idf-extra-components/tree/master/expat
dependencies:
idf: ">=4.4"
idf: ">=4.3"

View File

@ -1,5 +1,5 @@
version: "0.1.0"
version: "0.1.1"
description: Proportional-integral-derivative controller
url: https://github.com/espressif/idf-extra-components/tree/master/pid_ctrl
dependencies:
idf: ">=4.3"
idf: ">=4.4"

View File

@ -2,7 +2,16 @@
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../esp_encrypted_img)
set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../esp_encrypted_img ../cbor ../jsmn ../qrcode)
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "4.4")
list(APPEND EXTRA_COMPONENT_DIRS ../pid_ctrl)
endif()
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "5.0")
list(APPEND EXTRA_COMPONENT_DIRS ../sh2lib ../nghttp)
endif()
# Set the components to include the tests for.
set(TEST_COMPONENTS libsodium expat esp_encrypted_img CACHE STRING "List of components to test")

View File

@ -11,6 +11,8 @@
void app_main(void)
{
UNITY_BEGIN();
unity_run_menu();
//unity_run_tests_by_tag("[libsodium]", false);
unity_run_all_tests();
//unity_run_menu();
UNITY_END();
}

View File

@ -4,3 +4,11 @@ CONFIG_ESPTOOLPY_FLASHSIZE_4MB=y
CONFIG_PARTITION_TABLE_CUSTOM=y
CONFIG_PARTITION_TABLE_CUSTOM_FILENAME="partitions.csv"
CONFIG_PARTITION_TABLE_FILENAME="partitions.csv"
# Run-time checks of Heap and Stack
CONFIG_HEAP_POISONING_COMPREHENSIVE=y
CONFIG_COMPILER_STACK_CHECK_MODE_STRONG=y
CONFIG_COMPILER_STACK_CHECK=y
CONFIG_ESP_MAIN_TASK_STACK_SIZE=16000
CONFIG_UNITY_ENABLE_BACKTRACE_ON_FAIL=y

View File

@ -0,0 +1 @@
CONFIG_ESP32C3_REV_MIN_0=y

2
test_app/test_app.py Normal file
View File

@ -0,0 +1,2 @@
def test_app(dut):
dut.expect_unity_test_output(timeout=240)