ci: Publish test results

This commit is contained in:
Tomas Rezucha 2022-02-28 17:02:41 +01:00
parent 2019d71fd4
commit 06bd5dcbe3
5 changed files with 162 additions and 141 deletions

View File

@ -31,15 +31,15 @@ jobs:
- name: Merge binaries
working-directory: test_app/build
run: |
pip install esptool
python -m esptool --chip esp32 merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
. ${IDF_PATH}/export.sh
esptool.py --chip ${{ matrix.idf_target }} merge_bin --fill-flash-size 4MB -o flash_image.bin @flash_args
- uses: actions/upload-artifact@v2
with:
name: test_app_bin_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: |
test_app/build/flash_image.bin
path: test_app/build/flash_image.bin
#run-qemu: # Keeping this here for future reference. QEMU tests are not passing now
# Keeping this here for future reference. QEMU tests are not passing now
#run-qemu:
# name: Run Test App in QEMU
# needs: build
# strategy:
@ -63,6 +63,7 @@ jobs:
name: Run Test App on target
needs: build
strategy:
fail-fast: false
matrix:
idf_ver: ["release-v4.3", "release-v4.4", "latest"]
idf_target: ["esp32", "esp32c3", "esp32s3"]
@ -72,7 +73,7 @@ jobs:
runs-on: [self-hosted, linux, docker, esp32] # Unfortunately `${{ matrix.idf_target }}` is not accepted here
container:
image: python:3.7-slim-buster
options: --privileged
options: --privileged # Privileged mode has access to serial ports
steps:
- uses: actions/checkout@v2
with:
@ -89,4 +90,24 @@ jobs:
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 }}
run: pytest -s --junit-xml=./test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}.xml --embedded-services esp --target=${{ matrix.idf_target }}
- uses: actions/upload-artifact@v2
if: always()
with:
name: test_app_results_${{ matrix.idf_target }}_${{ matrix.idf_ver }}
path: test_app/*.xml
publish-results:
name: Publish Test App results
needs: run-target
if: always() # Run even if the previous step failed
runs-on: ubuntu-20.04
steps:
- name: Download Test results
uses: actions/download-artifact@v2
with:
path: test_results
- name: Publish Test Results
uses: EnricoMi/publish-unit-test-result-action@v1
with:
files: test_results/**/*.xml

View File

@ -1,25 +1,30 @@
# The following lines of boilerplate have to be in your project's
# CMakeLists in this exact order for cmake to work correctly
cmake_minimum_required(VERSION 3.5)
include($ENV{IDF_PATH}/tools/cmake/version.cmake)
set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../esp_encrypted_img ../cbor ../jsmn ../qrcode)
# Add newly added components to one of these lines:
# 1. Add here if the component is compatible with IDF >= v4.3
set(EXTRA_COMPONENT_DIRS ../libsodium ../expat ../cbor ../jsmn ../qrcode)
# 2. Add here if the component is compatible with IDF >= v4.4
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_GREATER_EQUAL "4.4")
list(APPEND EXTRA_COMPONENT_DIRS ../pid_ctrl)
list(APPEND EXTRA_COMPONENT_DIRS ../pid_ctrl ../esp_encrypted_img)
endif()
# 3. Add here if the component is compatible with IDF >= v5.0
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")
include($ENV{IDF_PATH}/tools/cmake/version.cmake) # $ENV{IDF_VERSION} was added after v4.3...
if("${IDF_VERSION_MAJOR}.${IDF_VERSION_MINOR}" VERSION_LESS "4.4")
set(EXCLUDE_COMPONENTS esp_encrypted_img)
endif()
# !This section should NOT be touched when adding new component!
# Take all components in EXTRA_COMPONENT_DIRS, strip leading '../' and add it to TEST_COMPONENTS
# The build system will build and link unit tests, if the component contains 'test' subdirectory
set(TEST_COMPONENTS "" CACHE STRING "List of components to test")
foreach (CMP_DIR ${EXTRA_COMPONENT_DIRS})
string(SUBSTRING ${CMP_DIR} 3 100 STRIPPED_CMP) # There should be no component name longer than 100 bytes...
list(APPEND TEST_COMPONENTS ${STRIPPED_CMP})
endforeach()
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(idf_extra_test_app)

View File

@ -4,15 +4,11 @@
* SPDX-License-Identifier: Apache-2.0
*/
#include <stdio.h>
#include <string.h>
#include "unity.h"
void app_main(void)
{
UNITY_BEGIN();
//unity_run_tests_by_tag("[libsodium]", false);
unity_run_all_tests();
//unity_run_menu();
UNITY_END();
}

View File

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