Skip to content

Commit

Permalink
Merge branch 'release/0.9'
Browse files Browse the repository at this point in the history
  • Loading branch information
truschival committed Mar 29, 2020
2 parents 5ae7b49 + 26008f2 commit c225278
Show file tree
Hide file tree
Showing 85 changed files with 4,257 additions and 2,097 deletions.
75 changes: 75 additions & 0 deletions .github/workflows/build_and_test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,75 @@
name: Build & Test
on:
push:
branches:
- develop
- master
- 'features/**'
pull_request:
branches:
- develop
jobs:
build_and_test:
runs-on: ubuntu-latest
env:
BUILD_DIR_HOST: /tmp/build
BUILD_DIR: /build
SRC_DIR: /src
steps:
- name: Clone Repository
uses: actions/checkout@v1
- name: Check Environment
run: |
docker --version
echo "USER: $USER ($UID:$GID)"
echo "github workspace: $GITHUB_WORKSPACE"
echo "host dir: $BUILD_DIR_HOST"
echo "container build dir: $BUILD_DIR"
echo "container src_dir: $SRC_DIR"
- name: Create build dir
run: |
mkdir -p $BUILD_DIR_HOST
chmod o+w $BUILD_DIR_HOST
touch $BUILD_DIR_HOST/created
ls -la $BUILD_DIR_HOST
- name: Pull docker container
run: docker pull ruschi/devlinuxqtquick2:latest
timeout-minutes: 5
- name: Start Docker
run: >
docker run -itd -u $UID:$GID --privileged --name build_container
-v$GITHUB_WORKSPACE:$SRC_DIR -v$BUILD_DIR_HOST:$BUILD_DIR
ruschi/devlinuxqtquick2
- name: Configure
run: >
docker exec build_container cmake
-DCMAKE_BUILD_TYPE=Debug
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=On
-H$SRC_DIR -B$BUILD_DIR
-DBUILD_TESTS=On -DTEST_COVERAGE=On -DBUILD_GTEST_FROM_SRC=On
- name: Build
run: docker exec build_container cmake --build $BUILD_DIR --parallel
- name: Run tests
run: docker exec -w $BUILD_DIR build_container bin/DigitalRooster_gtest
- name: Upload test results
if: failure()
uses: actions/upload-artifact@v1
with:
name: tests.log
path: /tmp/build/Digitalrooster_tests.log
- name: Collect coverage
run: >
docker exec -w $BUILD_DIR build_container
lcov --directory .
--capture --output-file $BUILD_DIR/coverage.info
- name: Prune 3rd party code from coverage info
run: >
docker exec -w $BUILD_DIR build_container
lcov --remove $BUILD_DIR/coverage.info
--output-file $BUILD_DIR/coverage.info
"/usr/*" "*/GTestExternal/*" "*/__/*"
- name: Upload coverage to codecov
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: /tmp/build/coverage.info
77 changes: 77 additions & 0 deletions .github/workflows/coverity.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
name: Coverity
on:
push:
branches:
- develop
- master
pull_request:
branches:
- develop
jobs:
run_coverity:
runs-on: ubuntu-latest
env:
BUILD_DIR_HOST: /tmp/build
BUILD_DIR: /build
SRC_DIR: /src
COVERITY_INSTALL_DIR: /tmp/coverity
COVERITY_RESULT_DIR: cov-int
COVERITY_TARBALL: digitalrooster_coverity.tar.bz2
steps:
- name: Clone Repository
uses: actions/checkout@v1
- name: Check Environment
run: |
docker --version
echo "USER: $USER $UID:$GID"
echo "github workspace: $GITHUB_WORKSPACE"
echo "host dir: $BUILD_DIR_HOST"
echo "container build dir: $BUILD_DIR"
echo "container src_dir: $SRC_DIR"
echo "Coverity tarball:" $COVERITY_TARBALL
echo "Coverity result:" $COVERITY_RESULT_DIR
- name: Create build dir
run: |
mkdir -p $BUILD_DIR_HOST
mkdir -p $COVERITY_INSTALL_DIR
- name: Install Coverity
run: |
wget -q https://scan.coverity.com/download/cxx/linux64 \
--post-data "token=$TOKEN&project=$GITHUB_REPOSITORY" \
-O cov-analysis-linux64.tar.gz
tar xzf cov-analysis-linux64.tar.gz --strip 1 -C $COVERITY_INSTALL_DIR
env:
TOKEN: ${{ secrets.COVERITY_TOKEN }}
- name: Pull docker container
run: docker pull ruschi/devlinuxqtquick2:latest
timeout-minutes: 5
- name: Start Docker
run: >
docker run -itd -u $UID:$GID --privileged --name build_container
-v$GITHUB_WORKSPACE:$SRC_DIR
-v$BUILD_DIR_HOST:$BUILD_DIR
-v$COVERITY_INSTALL_DIR:/coverity
ruschi/devlinuxqtquick2
- name: Configure (Release, No Tests)
run: >
docker exec build_container cmake
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_EXPORT_NO_PACKAGE_REGISTRY=On
-H$SRC_DIR -B$BUILD_DIR
-DBUILD_TESTS=Off -DTEST_COVERAGE=Off -DBUILD_GTEST_FROM_SRC=Off
- name: Gather Coverity build info
run: >
docker exec -w $BUILD_DIR build_container
/coverity/bin/cov-build --dir $COVERITY_RESULT_DIR make -j 3
- name: Package Coverity output
run: tar cjvf $COVERITY_TARBALL -C $BUILD_DIR_HOST $COVERITY_RESULT_DIR
- name: Upload Coverity Info
run: >
curl --form token=$TOKEN
--form email=thomas@ruschival.de
--form file=@$COVERITY_TARBALL
--form version=$GITHUB_SHA
--form description="Auto scan on $GITHUB_REF"
https://scan.coverity.com/builds?project=$GITHUB_REPOSITORY
env:
TOKEN: ${{ secrets.COVERITY_TOKEN }}
11 changes: 3 additions & 8 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ list(APPEND CMAKE_MODULE_PATH ${CMAKE_SOURCE_DIR}/CMakeModules/)
# Project Name
MESSAGE( STATUS "Running ${CMAKE_COMMAND} v${CMAKE_VERSION}" )
PROJECT(DigitalRooster
VERSION 0.8.0
VERSION 0.9.0
DESCRIPTION "A digital alarm clock and podcast player"
LANGUAGES CXX C
)
Expand Down Expand Up @@ -130,14 +130,13 @@ configure_file(
)

#Find includes in corresponding build directories
set(CMAKE_INCLUDE_CURRENT_DIR ON)
include_directories(${PROJECT_INCLUDE_DIR} ${GENERATED_DIR})

#-------------------------------------------------------------------------------
# Output configuration
#-------------------------------------------------------------------------------
#Since the "standard" cmake template works with component name set it
SET(COMPONENT_NAME ${PROJECT_NAME})
#SET(COMPONENT_NAME ${PROJECT_NAME})

# Make debug libs visible per default -> SET_TARGET_PROPERTIES
SET(CMAKE_DEBUG_POSTFIX "d")
Expand All @@ -155,12 +154,9 @@ SET(INSTALL_INCLUDE_DIR include CACHE PATH
"Installation directory for header files")
SET(INSTALL_CMAKE_DIR ${INSTALL_LIB_DIR}/cmake/ CACHE PATH
"Installation directory for CMake files")
SET(INSTALL_DOC_DIR "doc/${PROJECT_NAME}" CACHE PATH
SET(INSTALL_DOC_DIR "doc/${PROJECT_NAME}" CACHE PATH
"Installation directory for doxygen docs")

SET(version_config "${GENERATED_DIR}/${COMPONENT_NAME}ConfigVersion.cmake")
SET(component_config "${GENERATED_DIR}/${COMPONENT_NAME}Config.cmake")
SET(targets_export_name "${COMPONENT_NAME}Targets")
export(PACKAGE ${PROJECT_NAME})

#-------------------------------------------------------------------------------
Expand Down Expand Up @@ -279,7 +275,6 @@ SET(CPACK_COMPONENT_DEVELOP_DISPLAY_NAME "Libraries + Headers")
SET(CPACK_COMPONENT_APIDOC_DISPLAY_NAME "API Documentation")
SET(CPACK_COMPONENT_DEVELOP_DESCRIPTION "Components needed for development")
SET(CPACK_COMPONENT_APIDOC_DESCRIPTION "API Documentation")

SET(CPACK_NSIS_CONTACT "thomas@ruschival.de")
SET(CPACK_NSIS_MODIFY_PATH ON)

Expand Down
48 changes: 48 additions & 0 deletions CMakeModules/InstallLibraryComponents.cmake
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
MESSAGE(STATUS
"** Generating Package Configurations for ${COMPONENT_NAME} **")

SET(version_config "${GENERATED_DIR}/${COMPONENT_NAME}ConfigVersion.cmake")
SET(component_config "${GENERATED_DIR}/${COMPONENT_NAME}Config.cmake")
SET(targets_export_name "${COMPONENT_NAME}Targets")

include(CMakePackageConfigHelpers)
WRITE_BASIC_PACKAGE_VERSION_FILE(
${version_config}
VERSION ${COMPONENT_VERSION}
COMPATIBILITY SameMajorVersion
)

# Configure '<PROJECT-NAME>Config.cmake'
# Note: variable 'targets_export_name' used
CONFIGURE_FILE("${CMAKE_SOURCE_DIR}/cmake/Config.cmake.in"
"${component_config}" @ONLY)

INSTALL(TARGETS ${COMPONENT_NAME}
EXPORT ${targets_export_name}
COMPONENT DEVELOP
ARCHIVE DESTINATION ${INSTALL_LIB_DIR}
LIBRARY DESTINATION ${INSTALL_LIB_DIR}
RUNTIME DESTINATION ${INSTALL_BIN_DIR}
# this will add -I<prefix>include/component to client compile flags
#INCLUDES DESTINATION ${INSTALL_INCLUDE_DIR}/${COMPONENT_PATH}
INCLUDES DESTINATION ${INSTALL_INCLUDE_DIR}
)

INSTALL(DIRECTORY
${PROJECT_INCLUDE_DIR}/${COMPONENT_PATH}
COMPONENT DEVELOP
DESTINATION ${INSTALL_INCLUDE_DIR}
)

INSTALL(
EXPORT ${targets_export_name}
COMPONENT DEVELOP
NAMESPACE "${PROJECT_NAME}::"
DESTINATION "${INSTALL_CMAKE_DIR}/${COMPONENT_NAME}"
)

INSTALL(
FILES "${component_config}" "${version_config}"
COMPONENT DEVELOP
DESTINATION "${INSTALL_CMAKE_DIR}/${PROJECT_NAME}/${COMPONENT_NAME}"
)
53 changes: 53 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# Contributing

There are many ways to contribute to DigitalRoosterGui for everyone and all
skills and skill levels. If you don’t like programming, file a bug or feature
request, write documentation or just tell your friends about the project.

Here is a pretty good write-up on
[contributing to open source.](https://opensource.guide/how-to-contribute/)

It is a good idea to open an issue in the respective project beforehand
to share the thought and reach consensus before doing the programming.

## Social rules

*TL;DR:* This project welcomes everybody who acts decently and professionally.
Communicate with the other as if you are sitting together at your grandparents
dining table. If your grandma would frown upon your statement it is not
appropriate for this project either.

## Some technical rules

- This project uses
[git flow](https://nvie.com/posts/a-successful-git-branching-model/)
as development workflow. All features are developed in feature branches.
Only trivial corrections are fixed on the branch 'develop' directly.

- Create a pull request against the 'develop' branch.

- Write meaningful git
[commit messages](https://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)

- You should sign-off your commits (``git commit -s``) using a PGP key. This
`Signed-Off-by: your full name <email@address>` means that you publish your
changes to the project under the projects license (GPLv3) and you are
allowed to do this.

- **Code Style** - easy just automate it use the .clang-format file on
your code ``clang-format style=file``
I prefer ``snake_case`` for variables and methods but use ``PascalCase``
for classes - but this is no hard rule that prevents a merge.

- **Naming** - give the variables, classes, file names etc. meaningful names.
*Again, name it professionally without slur (remember you want to show it
to your grandma)*

- **Comments** Check your comments, when you are done! The comment should
match the code, be concise and contain relevant information

- **Write Tests** - code without unit test cases will most likely not get
merged

Note: Not all changes get immediately (or eventually) merged, even if all rules
are met.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[![License: GPL v3](https://img.shields.io/badge/License-GPL%20v3-blue.svg)](https://www.gnu.org/licenses/gpl-3.0)
[![Build Status](https://travis-ci.com/truschival/DigitalRoosterGui.svg?branch=develop)](https://travis-ci.com/truschival/DigitalRoosterGui)
[![Build Status](https://github.com/truschival/DigitalRoosterGui/workflows/Build%20%26%20Test/badge.svg "Build Develop/Master")](#)
[![codecov](https://codecov.io/gh/truschival/DigitalRoosterGui/branch/develop/graph/badge.svg)](https://codecov.io/gh/truschival/DigitalRoosterGui)
[![Codacy Badge](https://api.codacy.com/project/badge/Grade/a95a270a2f8548f59a26811e7f2de20b)](https://www.codacy.com/app/truschival/DigitalRoosterGui)
[![Coverity](https://scan.coverity.com/projects/18711/badge.svg)](https://scan.coverity.com/projects/truschival-digitalroostergui)
Expand Down
Loading

0 comments on commit c225278

Please sign in to comment.