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

Merget develop as v1.0.0 #1

Merged
merged 13 commits into from
Oct 28, 2024
Merged
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
81 changes: 48 additions & 33 deletions .github/workflows/ctest.yml
Original file line number Diff line number Diff line change
@@ -1,14 +1,15 @@
# This is a basic workflow to help you get started with Actions

name: CTest_on_push_and_pull_request
name: Build and Test

# Controls when the workflow will run
on:
# Triggers the workflow on push or pull request events but only for the main branch
workflow_call:
push:
branches: [ main, develop ]
branches: [ develop ]
pull_request:
branches: [ main, develop ]
branches: [ develop ]

# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
Expand All @@ -21,46 +22,60 @@ jobs:
matrix:
os: [ubuntu-latest, windows-latest]
build: [Release, Debug]
target: [x64, win32]
compiler: [gcc, clang, msvc]
exclude:
- {os: ubuntu-latest, compiler: msvc}
- {os: ubuntu-latest, target: win32}
- {os: windows-latest, compiler: gcc}
- {os: windows-latest, compiler: clang}

# Test on specified OS
runs-on: ${{ matrix.os }}

# Configure - Build - Test
steps:
# Checks-out repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
- uses: actions/checkout@v4.1.7
with:
submodules: true

# Runs commands using the runners shell
- name: Configuration
run: |
mkdir build
cd build
cmake .. -DCMAKE_BUILD_TYPE:STRING=${{ matrix.build }}
# Configuration for GCC
- name: Configuration and build for gcc
if: matrix.compiler == 'gcc'
uses: threeal/cmake-action@v2.0.0
with:
c-compiler: gcc
cxx-compiler: g++
build-args: --config ${{ matrix.build }}

# Build for Linux
- name: Build for Linux
if: matrix.os == 'ubuntu-latest'
run: |
cd build
cmake --build . --target all --config ${{ matrix.build }} --clean-first -j4
# Configuration for Clang
- name: Configuration for and build clang
if: matrix.compiler == 'clang'
uses: threeal/cmake-action@v2.0.0
with:
c-compiler: clang
cxx-compiler: clang++
build-args: --config ${{ matrix.build }}

# Build for Windows
- name: Build for Windows
if: matrix.os == 'windows-latest'
run: |
cd build
cmake --build . --target all_build --config ${{ matrix.build }} --clean-first -j4
# Configuration for MSVC
- name: Configuration for and build msvc
if: matrix.compiler == 'msvc'
uses: threeal/cmake-action@v2.0.0
with:
c-compiler: cl
cxx-compiler: cl
args : -A ${{ matrix.target }}
build-args: --config ${{ matrix.build }}

- name: Test
run: |
cd build
ctest --rerun-failed --output-on-failure -j 4

# Created report only when Linux and Debug
- name: Gcovr ( Linux and Debug only )
if: matrix.os == 'ubuntu-latest' && matrix.build == 'Debug'
run: |
sudo apt-get install gcovr -y > /dev/null
gcovr -r . -e build

uses: threeal/ctest-action@v1.1.0

- name: Check Test Coverage
if: matrix.compiler == 'gcc' && matrix.build == 'Debug'
uses: threeal/gcovr-action@v1.1.0
with:
coveralls-send: true
excludes: |
build/*
test/*
74 changes: 5 additions & 69 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,82 +4,18 @@ All notable changes to this project will be documented in this file.
The format is based on [Keep a Changelog](http://keepachangelog.com/)
and this project adheres to [Semantic Versioning](http://semver.org/).

## [Unreleased] - YYYY-MM-DD
### Added
### Changed
### Fixed

## [1.4.0] - 2022-01-22
### Added
- [Issue #20](https://github.com/suikan4github/template_application/issues/20) : Add doxygen auto generation.
### Changed
### Fixed

## [1.3.0] - 2022-01-10
### Added
- [Issue #17](https://github.com/suikan4github/template_application/issues/17) : Add gcovr support.
### Changed
- [Issue #18](https://github.com/suikan4github/template_application/issues/18) : Display alll warning during build
### Fixed

## [1.2.0] - 2022-01-02
### Added
- [Issue #13](https://github.com/suikan4github/template_application/issues/13) : Add gcov support.
- [Issue #14](https://github.com/suikan4github/template_application/issues/14) : Add Windows run on action
### Changed
### Fixed

## [1.1.4] - 2021-12-12
### Added
### Changed
### Fixed
- [Issue #6](https://github.com/suikan4github/template_application/issues/6) : Need detail report of ctest in case of test failed.
- [Issue #7](https://github.com/suikan4github/template_application/issues/7) : Guard death test by conditional compile.
- [Issue #8](https://github.com/suikan4github/template_application/issues/8) : Add develop branch to the Action trigger "pull_request"
- [Issue #9](https://github.com/suikan4github/template_application/issues/9) : Add Release build to test of the GitHub Actions
- [Issue #10](https://github.com/suikan4github/template_application/issues/10) : Change name of Death test name.
- [Issue #11](https://github.com/suikan4github/template_application/issues/11) : Release test in GitHub Actions is not working good

## [1.1.3] - 2021-12-11
### Added
### Changed
### Fixed
- Corrected spells and deleted redundant explanations.

## [1.1.2] - 2021-12-11
### Added
### Changed
### Fixed
- Corrects severe mistakes of install commands

## [1.1.1] - 2021-12-11
### Added
### Changed
- Make sample program looks better
### Fixed

## [1.1.0] - 2021-12-11
## [Unreleased] - YYYY-MM-DD
### Added
- Added "Customize the project" to README.md
### Changed
### Fixed
- Corrected spells.
- Corrected the URL of the CHANGELOG.md

## [1.0.0] - 2021-12-10
## [v1.0.0] - 2024-10-28
- Initial release of project.
### Added
- Initial release of project
### Changed
### Fixed


[Unreleased]: https://github.com/suikan4github/template_application/compare/v1.4.0...develop
[1.4.0]: https://github.com/suikan4github/template_application/compare/v1.3.0...v1.4.0
[1.3.0]: https://github.com/suikan4github/template_application/compare/v1.2.0...v1.3.0
[1.2.0]: https://github.com/suikan4github/template_application/compare/v1.1.4...v1.2.0
[1.1.4]: https://github.com/suikan4github/template_application/compare/v1.1.3...v1.1.4
[1.1.3]: https://github.com/suikan4github/template_application/compare/v1.1.2...v1.1.3
[1.1.2]: https://github.com/suikan4github/template_application/compare/v1.1.1...v1.1.2
[1.1.1]: https://github.com/suikan4github/template_application/compare/v1.1.0...v1.1.1
[1.1.0]: https://github.com/suikan4github/template_application/compare/v1.0.0...v1.1.0
[1.0.0]: https://github.com/suikan4github/template_application/compare/v0.0.0...v1.0.0
[Unreleased]: https://github.com/suikan4github/template_application/compare/v1.0.0...develop
[v1.0.0]: https://github.com/suikan4github/template_application/compare/v0.0.0...v1.0.0
63 changes: 32 additions & 31 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,49 +1,50 @@
# CMake 3.15 or newer is requried because of CMP0091.
cmake_minimum_required(VERSION "3.15")

# The CMake compatibility flag for MSVC runtime library flag. New in 3.15. Must set "NEW"
cmake_policy(SET CMP0091 "NEW")
# Enforce the /MT or /MTd as link option for MS Visual Studio C++
set(CMAKE_MSVC_RUNTIME_LIBRARY "MultiThreaded$<$<CONFIG:Debug>:Debug>")


#----------------------------------------------------------------------------
# Parameters inside project
project("template_application")

# Compiler option
# GoogleTest requirest C++11 or later
set(CMAKE_CXX_STANDARD "11")
set(CMAKE_CXX_STANDARD "17")
set(CMAKE_CXX_STANDARD_REQUIRED "ON")
set(CMAKE_CXX_EXTENSIONS "OFF")

# In the toplevel CMakeLists.txt, we can not use the
# $WIN or $Unix. To avoid this problem, we check the
# Compile path string. If it contains arm-none-eabi,
# We guess this is bare metal target.

# Is compiler arm-none-eabi?
string(FIND ${CMAKE_CXX_COMPILER} "arm-none-eabi" FOUNDPOS)
if( ${FOUNDPOS} GREATER "-1") # If yes, it is pico
message(STATUS "Target is bare metal")
# obtain pico-sdk from GIT
# (note this can come from environment, CMake cache etc)
set(PICO_SDK_FETCH_FROM_GIT on)

# pico_sdk_import.cmake is a single file copied from this SDK
# note: this must happen before project()
include(pico_sdk_import.cmake)


#----------------------------------------------------------------------------
# Do not edit the lines below
# initialize the Raspberry Pi Pico SDK
pico_sdk_init()
endif() # string(FIND CMAKE_CXX_COMPILER "arm-none-eabi") GREATER_EQUAL 0

# Executable name
set(EXECUTABLE_NAME ${PROJECT_NAME})
# Pico SDK requires the project name must be set after
# including pico_sdk_import.cmake. On the other hand, CMake
# requires to set the project name at the toplevel.
# So, we delcare here.
project("app")

# Test executable and library name
set(TEST_EXECUTABLE_NAME "test_${PROJECT_NAME}")
set(TEST_LIBRARY_NAME "${PROJECT_NAME}_for_test")
if( ${FOUNDPOS} LESS "0") # If yes, it is Windows or Linux
message(STATUS "Target is Windows or Linux")

# Enable CTest
# This command automatically run the enable_test() command.
# And the CMake specification requires to place the enable_test() at the
# root of the project, to run the ctest correctly.
# Thus, place this command at the root of project.
include("CTest")
# Unit test.
enable_testing()
add_subdirectory("test")

# Using thread inside application
find_package("Threads" REQUIRED)
endif() # string(FIND CMAKE_CXX_COMPILER "arm-none-eabi") GREATER_EQUAL 0

set(CPACK_PROJECT_NAME ${PROJECT_NAME})
set(CPACK_PROJECT_VERSION ${PROJECT_VERSION})
include("CPack")

# Subdirectories
add_subdirectory("src")
add_subdirectory("test")
add_subdirectory("doc")

8 changes: 4 additions & 4 deletions doc/Doxyfile → Doxyfile
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ DOXYFILE_ENCODING = UTF-8
# title of most generated pages and in a few other places.
# The default value is: My Project.

PROJECT_NAME = "Test Library"
PROJECT_NAME = "Windows / Linux / RasPi Pico 3 mode program"

# The PROJECT_NUMBER tag can be used to enter a project or revision number. This
# could be handy for archiving the generated documentation or if some version
Expand Down Expand Up @@ -74,7 +74,7 @@ PROJECT_ICON =
# entered, it will be relative to the location where doxygen was started. If
# left blank the current directory will be used.

OUTPUT_DIRECTORY =
OUTPUT_DIRECTORY = docs

# If the CREATE_SUBDIRS tag is set to YES then doxygen will create up to 4096
# sub-directories (in 2 levels) under the output directory of each output format
Expand Down Expand Up @@ -949,7 +949,7 @@ WARN_LOGFILE =
# spaces. See also FILE_PATTERNS and EXTENSION_MAPPING
# Note: If this tag is empty the current directory is searched.

INPUT = ../src
INPUT = src

# This tag can be used to specify the character encoding of the source files
# that doxygen parses. Internally doxygen uses the UTF-8 encoding. Doxygen uses
Expand Down Expand Up @@ -1041,7 +1041,7 @@ FILE_PATTERNS = *.c \
# be searched for input files as well.
# The default value is: NO.

RECURSIVE = NO
RECURSIVE = YES

# The EXCLUDE tag can be used to specify files and/or directories that should be
# excluded from the INPUT source files. This way you can easily exclude a
Expand Down
Loading