Compare commits

...

24 Commits

Author SHA1 Message Date
cf49a99e22 fix github action error
Some checks failed
Thomas the tank engine - Build the ESP-IDF Project / build (esp32, latest) (push) Failing after 35s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32, release-v5.3) (push) Failing after 14s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32, release-v5.4) (push) Failing after 15s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c3, latest) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c3, release-v5.3) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c3, release-v5.4) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c5, latest) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c5, release-v5.3) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32c5, release-v5.4) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32h2, latest) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32h2, release-v5.3) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32h2, release-v5.4) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32s3, latest) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32s3, release-v5.3) (push) Failing after 0s
Thomas the tank engine - Build the ESP-IDF Project / build (esp32s3, release-v5.4) (push) Failing after 0s
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2025-01-22 09:07:42 +01:00
9d6dad6d63 use ESP-IDF v5.3 and v5.4 in CI
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2025-01-21 21:24:22 +01:00
829d697c55 use 5.3 only
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:32:37 +01:00
489a7286ae fix mcu name
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:28:26 +01:00
bbb8ec6500 only latest two stable idf version
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:26:54 +01:00
83b132074a remove additional matrix setting
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:25:26 +01:00
2f78cea324 multiple includes
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:23:03 +01:00
10bb6ee768 remove latest build
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:22:02 +01:00
d83b1e1918 new idf version 5.4
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:21:14 +01:00
b62d1463e1 trying compile against latest
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:16:49 +01:00
fc73c13740 stop last running action
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:05:15 +01:00
fd8e45fbb8 some configuration changes
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:05:04 +01:00
46661162b0 add weekly build
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-12-10 21:04:28 +01:00
d798433de6 enable build on push again
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:55:42 +02:00
9fe40e1c77 remove local logger component
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:53:01 +02:00
c4dcfe6efe change esp includes to global
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:53:01 +02:00
07f61c24bf remove push trigger for action
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:53:01 +02:00
80e7d9e702 add merge queue
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:53:00 +02:00
798412d563 optimize build/test matrix
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-08-11 23:53:00 +02:00
42a5c411fd rename github action task
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-05-18 00:26:44 +02:00
7ec1887027 remove ESP-IDF v4.4 testing
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-05-17 12:09:03 +02:00
0944d29597 starting with component unit testing (running on device)
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-05-17 12:03:16 +02:00
05f8519864 adding pytest PoC for real devices
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-05-13 22:54:35 +02:00
3b3f9b1f4d use ESP-IDF releases instead of specific versions
Signed-off-by: Peter Siegmund <developer@mars3142.org>
2024-05-13 21:01:43 +02:00
15 changed files with 112 additions and 15 deletions

View File

@@ -1,16 +1,22 @@
name: Thomas the tank engine - Build and Artifact the ESP-IDF Project name: Thomas the tank engine - Build the ESP-IDF Project
on: on:
push: push:
pull_request: pull_request:
merge_group:
schedule:
- cron: "0 5 * * 3"
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs: jobs:
build: build:
strategy: strategy:
matrix: matrix:
idf_ver: idf_ver: [release-v5.3, release-v5.4, latest]
[release-v4.4.7, release-v5.0.6, release-v5.1.4, release-v5.2.1] idf_target: [esp32, esp32s3, esp32c3, esp32c5, esp32h2]
idf_target: [esp32, esp32s3, esp32c3]
runs-on: ubuntu-latest runs-on: ubuntu-latest

2
.gitignore vendored
View File

@@ -5,6 +5,7 @@ sdkconfig.old
# They ignored Idea (Webstorm) completely # They ignored Idea (Webstorm) completely
.idea/ .idea/
.cache/
# However, they kept the following 4 files version controlled # However, they kept the following 4 files version controlled
.vscode/* .vscode/*
@@ -12,3 +13,4 @@ sdkconfig.old
!.vscode/launch.json !.vscode/launch.json
!.vscode/extensions.json !.vscode/extensions.json
.history/* .history/*
__pycache__

View File

@@ -1,3 +0,0 @@
idf_component_register(SRCS "osr_ble.c"
INCLUDE_DIRS "."
PRIV_REQUIRES "nvs_flash")

View File

@@ -1,2 +1,6 @@
idf_component_register(SRCS "main.c" idf_component_register(SRCS "main.c" "osr_ble.c"
INCLUDE_DIRS ".") INCLUDE_DIRS "."
PRIV_REQUIRES
nvs_flash
spi_flash
)

View File

@@ -1,19 +1,55 @@
#include <esp_chip_info.h>
#include <esp_flash.h>
#include <esp_log.h>
#include <esp_task_wdt.h> #include <esp_task_wdt.h>
#include <stdio.h> #include <stdio.h>
#include "osr_ble.h" #include "osr_ble.h"
#include "sdkconfig.h"
#define TAG "app"
void esp32_info() {
esp_chip_info_t chip_info;
uint32_t flash_size;
esp_chip_info(&chip_info);
printf("This is %s chip with %d CPU core(s), %s%s%s%s, ", CONFIG_IDF_TARGET,
chip_info.cores,
(chip_info.features & CHIP_FEATURE_WIFI_BGN) ? "WiFi/" : "",
(chip_info.features & CHIP_FEATURE_BT) ? "BT" : "",
(chip_info.features & CHIP_FEATURE_BLE) ? "BLE" : "",
(chip_info.features & CHIP_FEATURE_IEEE802154)
? ", 802.15.4 (Zigbee/Thread)"
: "");
unsigned major_rev = chip_info.revision / 100;
unsigned minor_rev = chip_info.revision % 100;
printf("silicon revision v%d.%d, ", major_rev, minor_rev);
if (esp_flash_get_size(NULL, &flash_size) != ESP_OK) {
printf("Get flash size failed");
return;
}
printf(
"%" PRIu32 "MB %s flash\n", flash_size / (uint32_t)(1024 * 1024),
(chip_info.features & CHIP_FEATURE_EMB_FLASH) ? "embedded" : "external");
printf("Minimum free heap size: %" PRIu32 " bytes\n",
esp_get_minimum_free_heap_size());
}
void setup() { void setup() {
osr_ble_init(); osr_ble_init();
ESP_LOGI(TAG, "Setup done!");
} }
void loop() { void loop(void* args) {
ESP_ERROR_CHECK(esp_task_wdt_reset()); while (1) {
vTaskDelay(pdMS_TO_TICKS(1000));
ESP_LOGI(TAG, "Hello World!");
}
} }
void app_main() { void app_main() {
setup(); setup();
while (1) { xTaskCreatePinnedToCore(loop, "loop", 4096, NULL, 5, NULL, 1);
loop();
}
} }

4
pytest.ini Normal file
View File

@@ -0,0 +1,4 @@
[pytest]
addopts = --embedded-services esp,idf -s
python_files = *.py
timeout = 60

16
test/CMakeLists.txt Normal file
View File

@@ -0,0 +1,16 @@
# This is the project CMakeLists.txt file for the test subproject
cmake_minimum_required(VERSION 3.16)
# Include the components directory of the main application:
#
set(EXTRA_COMPONENT_DIRS "../components")
# Set the components to include the tests for.
# This can be overriden from CMake cache:
# - when invoking CMake directly: cmake -D TEST_COMPONENTS="xxxxx" ..
# - when using idf.py: idf.py -T xxxxx build
#
set(TEST_COMPONENTS "logger" CACHE STRING "List of components to test")
include($ENV{IDF_PATH}/tools/cmake/project.cmake)
project(component_unit_test)

6
test/Makefile Normal file
View File

@@ -0,0 +1,6 @@
test:
@echo "Running tests..."
@idf.py fullclean build
pytest
.PHONE: test

2
test/main/CMakeLists.txt Normal file
View File

@@ -0,0 +1,2 @@
idf_component_register(SRCS "components_test.c"
INCLUDE_DIRS ".")

View File

@@ -0,0 +1,16 @@
#include <stdio.h>
#include <string.h>
#include "unity.h"
static void print_banner(const char* text);
void app_main(void) {
print_banner("Running all the registered tests");
UNITY_BEGIN();
unity_run_all_tests();
UNITY_END();
}
static void print_banner(const char* text) {
printf("\n#### %s #####\n\n", text);
}

6
test/pytest_unittest.py Normal file
View File

@@ -0,0 +1,6 @@
import pytest
from pytest_embedded import Dut
def test_unit_test(dut: Dut) -> None:
dut.expect("0 Failures")
dut.expect("Returned from app_main")

2
test/sdkconfig.defaults Normal file
View File

@@ -0,0 +1,2 @@
# disable watchdog
CONFIG_ESP_TASK_WDT_EN=n