Konstantin Oblaukhov 5 лет назад
Родитель
Сommit
64800e74eb
3 измененных файлов с 20 добавлено и 1 удалено
  1. 14 1
      .github/workflows/cmake.yml
  2. 2 0
      README.md
  3. 4 0
      tests/bsp/CMakeLists.txt

+ 14 - 1
.github/workflows/cmake.yml

@@ -1,4 +1,4 @@
-name: CMake
+name: Tests
 
 on: [push]
 
@@ -41,3 +41,16 @@ jobs:
       working-directory: ${{runner.workspace}}/tests/cmsis/build
       shell: bash
       run: cmake --build . --config $BUILD_TYPE
+
+    - name: Create build directory for tests/hal
+      run: cmake -E make_directory ${{runner.workspace}}/tests/hal/build
+
+    - name: Configure tests/hal
+      shell: bash
+      working-directory: ${{runner.workspace}}/tests/hal/build
+      run: cmake -DFETCH_ST_SOURCES=TRUE $GITHUB_WORKSPACE/tests/hal/
+
+    - name: Build tests/hal
+      working-directory: ${{runner.workspace}}/tests/hal/build
+      shell: bash
+      run: cmake --build . --config $BUILD_TYPE

+ 2 - 0
README.md

@@ -1,5 +1,7 @@
 # About
 
+![Tests](https://github.com/ObKo/stm32-cmake/workflows/Tests/badge.svg)
+
 This project is used to develop applications for the STM32 - ST's ARM Cortex-Mx MCUs. 
 It uses cmake and GCC, along with newlib (libc), STM32Cube. Supports F0 F1 F2 F3 F4 F7 G0 G4 H7 L0 L1 L4 device families.
 

+ 4 - 0
tests/bsp/CMakeLists.txt

@@ -37,6 +37,10 @@ set(BANNED_BOARDS STM32756G_EVAL)
 project(bsp-test C ASM)
 set(CMAKE_INCLUDE_CURRENT_DIR TRUE)
 
+if(FETCH_ST_SOURCES)
+    stm32_fetch_cube(${TEST_FAMILIES})
+endif()
+
 find_package(CMSIS REQUIRED)
 find_package(HAL REQUIRED)
 find_package(BSP REQUIRED)