Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add ability to manually trigger a workflow + run only on PR and master push #317

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .github/workflows/cmake.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,11 @@
name: Tests
on:
push:
branches:
- master
pull_request:
workflow_dispatch:

on: [push, pull_request]

env:
# Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.)
Expand Down
19 changes: 16 additions & 3 deletions examples/blinky/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
cmake_minimum_required(VERSION 3.16)
set(CMAKE_TOOLCHAIN_FILE ${CMAKE_CURRENT_SOURCE_DIR}/../../cmake/stm32_gcc.cmake)

set(STM32_CUBE_F4_PATH "C:\\GIT\\STM32CubeF4")
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Use the stm32_fetch_cube(F4) function, in the if stm32_fetch_cube(F4) instead.

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This was not supposed to be pushed. It slipped though on commit


# Configure here which STM32 target(s) to build
option(BLINKY_F4_EXAMPLE "Compile F4 example" ON)
option(BLINKY_F1_EXAMPLE "Compile F1 example" OFF)
Expand All @@ -19,7 +21,7 @@ endif()
set(CMAKE_INCLUDE_CURRENT_DIR TRUE)


set(HAL_COMP_LIST RCC GPIO CORTEX)
set(HAL_COMP_LIST RCC GPIO CORTEX PWR)
set(CMSIS_COMP_LIST "")

if(BLINKY_F4_EXAMPLE)
Expand Down Expand Up @@ -51,15 +53,26 @@ find_package(HAL COMPONENTS "${HAL_COMP_LIST}" REQUIRED)

# STM32F4-Discovery
if(BLINKY_F4_EXAMPLE)
add_executable(stm32-blinky-f4 ${MAIN_SOURCE_FILE} stm32f4xx_hal_conf.h)
target_link_libraries(stm32-blinky-f4
add_executable(stm32-blinky-f4 ${MAIN_SOURCE_FILE} )

target_link_libraries(stm32-blinky-f4 PRIVATE hal_lib)

add_library(hal_lib STATIC stm32f4xx_hal_conf.h)
target_link_libraries(hal_lib PUBLIC
HAL::STM32::F4::RCC
HAL::STM32::F4::GPIO
HAL::STM32::F4::CORTEX
HAL::STM32::F4::PWR
CMSIS::STM32::F407VG
STM32::NoSys
)
target_compile_options(stm32-blinky-f4 PRIVATE -Wall -Wundef -Wextra)

stm32_print_size_of_target(stm32-blinky-f4)

#set_source_files_properties(blinky.c PROPERTIES COMPILE_FLAGS -Wall -Wundef -Wextra)


endif()

# STM32VL-Discovery
Expand Down