-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
85 changed files
with
4,257 additions
and
2,097 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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}" | ||
) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.