server-sdk/.gitlab-ci.yml
2019-11-08 18:28:06 +01:00

88 lines
1.4 KiB
YAML

# for
stages:
- build
- test
# To clone also submodules
variables:
PRO_FILE: ../server-sdk.pro
SCRIPT_PATH: scripts
cache:
paths:
- build/
##########
# Build
##########
build: # name of task
stage: build # in what stage it will run ( 1. build then test etc )
tags: # Tags are used to choose correct gitlab-runner
- shell # spaceti-runner server has running runners and one has tag 'hw'
script: # run in bash
- mkdir -p build
- cd build
- qmake $PRO_FILE
- make -j4
##########
# Test
##########
test:
stage: test
tags:
- shell
script:
- mkdir -p build
- cd build
- qmake $PRO_FILE
- make check
# memory leak check for unittest
valgrind:
stage: test
tags:
- shell
script:
- mkdir -p build
- cd build
- qmake $PRO_FILE
- valgrind make check
# Quality of code
cppcheck:
stage: test
tags:
- shell
#allow_failure: true # Probably needed to allow failure
script:
- $SCRIPT_PATH/cppcheck.sh
dependencies: []
# Common checks ( Line endings )
lineendings:
stage: test
tags:
- shell
script:
- server-sdk/scripts/check.sh
dependencies: []
codecoverage:
stage: test
tags:
- shell
script:
- server-sdk/scripts/codecoverage.sh
coverage: '/^\s+functions..:\s+(\d+\.\d+%).+$/'
dependencies: []
doc:
stage: test
tags:
- shell
script:
- server-sdk/scripts/doc.sh clean # 'clean' better clean before generating documentation
dependencies: []