Skip to content

Commit

Permalink
Add basic CI.
Browse files Browse the repository at this point in the history
  • Loading branch information
kubasejdak committed Feb 15, 2020
1 parent b9ace13 commit c6fe73d
Show file tree
Hide file tree
Showing 39 changed files with 349 additions and 162 deletions.
46 changes: 0 additions & 46 deletions .github/workflows/build-linux.yml

This file was deleted.

31 changes: 0 additions & 31 deletions .github/workflows/docs.yml

This file was deleted.

53 changes: 0 additions & 53 deletions .github/workflows/quality.yml

This file was deleted.

17 changes: 17 additions & 0 deletions .gitlab-ci.yml
@@ -0,0 +1,17 @@
variables:
GIT_SUBMODULE_STRATEGY: recursive

stages:
- build-GCC
- build-Clang
- test
- coverage
- quality
- deploy

include:
- ".gitlab/ci/build-tests-linux.yml"
- ".gitlab/ci/coverage-linux.yml"
- ".gitlab/ci/deploy.yml"
- ".gitlab/ci/quality.yml"
- ".gitlab/ci/run-tests-linux.yml"
77 changes: 77 additions & 0 deletions .gitlab/ci/build-tests-linux.yml
@@ -0,0 +1,77 @@
.Build_Test_Linux:
tags:
- linux
- shared
dependencies: []
artifacts:
name: "${CI_JOB_NAME}_${CI_JOB_ID}"
expire_in: 2 weeks
paths:
- ${CI_JOB_NAME}/bin
script:
- mkdir ${CI_JOB_NAME}
- cd ${CI_JOB_NAME}

# Build application.
- ../tools/build/${Script}.sh
- make

.Build_Test_Linux_GCC:
extends: .Build_Test_Linux
stage: build-GCC
image: kubasejdak/gcc:latest

.Build_Test_Linux_ARM_GCC:
extends: .Build_Test_Linux
stage: build-GCC
image: kubasejdak/arm-linux-gnueabihf-gcc:latest

.Build_Test_Linux_Clang:
extends: .Build_Test_Linux
stage: build-Clang
image: kubasejdak/clang:latest

.Build_Test_Linux_ARM_Clang:
extends: .Build_Test_Linux
stage: build-Clang
image: kubasejdak/arm-linux-gnueabihf-clang:latest

Hardware_Linux_ARM_Clang_Debug_Build:
extends: .Build_Test_Linux_ARM_Clang
variables:
Script: "hardware-linux-arm-clang-9-debug"

Hardware_Linux_ARM_Clang_Release_Build:
extends: .Build_Test_Linux_ARM_Clang
variables:
Script: "hardware-linux-arm-clang-9-release"

Hardware_Linux_ARM_GCC_Debug_Build:
extends: .Build_Test_Linux_ARM_GCC
variables:
Script: "hardware-linux-arm-gcc-9-debug"

Hardware_Linux_ARM_GCC_Release_Build:
extends: .Build_Test_Linux_ARM_GCC
variables:
Script: "hardware-linux-arm-gcc-9-release"

Hardware_Linux_Clang_Debug_Build:
extends: .Build_Test_Linux_Clang
variables:
Script: "hardware-linux-clang-9-debug"

Hardware_Linux_Clang_Release_Build:
extends: .Build_Test_Linux_Clang
variables:
Script: "hardware-linux-clang-9-release"

Hardware_Linux_GCC_Debug_Build:
extends: .Build_Test_Linux_GCC
variables:
Script: "hardware-linux-gcc-9-debug"

Hardware_Linux_GCC_Release_Build:
extends: .Build_Test_Linux_GCC
variables:
Script: "hardware-linux-gcc-9-release"
27 changes: 27 additions & 0 deletions .gitlab/ci/coverage-linux.yml
@@ -0,0 +1,27 @@
.Linux_Coverage:
stage: coverage
image: kubasejdak/gcc:latest
tags:
- linux
- shared
dependencies: []
artifacts:
name: "${CI_JOB_NAME}_${CI_JOB_ID}"
expire_in: 2 weeks
paths:
- ${CI_JOB_NAME}/coverage
script:
- mkdir ${CI_JOB_NAME}
- cd ${CI_JOB_NAME}

# Build application.
- ../tools/build/${Script}.sh -DCOVERAGE=ON
- make
- bin/${App} [unit]
- make coverage

Hardware_Coverage:
extends: .Linux_Coverage
variables:
Script: "hardware-linux-gcc-9-debug"
App: "hardware"
35 changes: 35 additions & 0 deletions .gitlab/ci/deploy.yml
@@ -0,0 +1,35 @@
codecov.io:
stage: deploy
only:
- master
image: kubasejdak/gcc:latest
tags:
- linux
- shared
dependencies:
- Coverage_Total
script:
- cd Coverage_Total
- bash -c "bash <(curl -s https://codecov.io/bash) -t ${CODECOV_TOKEN}"

pages:
stage: deploy
only:
- master
image: kubasejdak/gcc:latest
tags:
- linux
- shared
dependencies: []
artifacts:
paths:
- public
script:
- mkdir public
- mkdir ${CI_JOB_NAME}
- cd ${CI_JOB_NAME}

# Generate documentation.
- ../tools/build/hardware-linux-gcc-9-debug.sh
- make doxygen
- mv docs/* ../public
65 changes: 65 additions & 0 deletions .gitlab/ci/quality.yml
@@ -0,0 +1,65 @@
Clang_Format:
stage: quality
image: kubasejdak/clang:latest
tags:
- linux
- shared
dependencies: []
script:
- tools/check-clang-format.sh lib test
- |
git update-index -q --refresh
git diff-index --quiet HEAD
if [ ${?} -ne 0 ]; then
echo "The following bad source code formatting was detected:"
git --no-pager diff
exit 1
fi
.Clang_Tidy:
stage: quality
tags:
- linux
- shared
dependencies: []
artifacts:
name: "${CI_JOB_NAME}_${CI_JOB_ID}"
expire_in: 2 weeks
paths:
- ${CI_JOB_NAME}/errors.yml
- ${CI_JOB_NAME}/compile_commands.json
script:
- mkdir ${CI_JOB_NAME}
- cd ${CI_JOB_NAME}

# Check build.
- ../tools/build/${Script}.sh
- ../tools/check-clang-tidy.sh

Hardware_Linux_Clang_Tidy:
extends: .Clang_Tidy
image: kubasejdak/clang:latest
variables:
Script: "hardware-linux-clang-9-debug"

Coverage_Total:
stage: quality
image: kubasejdak/gcc:latest
tags:
- linux
- shared
dependencies:
- Hardware_Coverage
artifacts:
name: "${CI_JOB_NAME}_${CI_JOB_ID}"
expire_in: 2 weeks
paths:
- ${CI_JOB_NAME}
script:
- mkdir ${CI_JOB_NAME}
- cd ${CI_JOB_NAME}

- |
lcov -a ../Hardware_Coverage/coverage/coverage.info \
-o coverage.info
- genhtml coverage.info -o html
38 changes: 38 additions & 0 deletions .gitlab/ci/run-tests-linux.yml
@@ -0,0 +1,38 @@
.Run_Test:
stage: test
variables:
GIT_STRATEGY: none
script:
- cd ${AppArtifact}/bin
- ./${App} ${TestTags}

.Run_Test_Linux:
extends: .Run_Test
stage: test
tags:
- linux
- shared
image: kubasejdak/gcc:latest

#.Run_Test_Linux_ARM:
# extends: .Run_Test
# stage: test
# tags:
# - raspberrypi

#Hardware_Linux_ARM_UT:
# extends: .Run_Test_Linux_ARM
# dependencies:
# - Hardware_Linux_ARM_GCC_Debug_Build
# variables:
# AppArtifact: "Hardware_Linux_ARM_GCC_Debug_Build"
# App: "hardware"

Hardware_Linux_UT:
extends: .Run_Test_Linux
dependencies:
- Hardware_Linux_GCC_Debug_Build
variables:
AppArtifact: "Hardware_Linux_GCC_Debug_Build"
App: "hardware"

0 comments on commit c6fe73d

Please sign in to comment.