This repository has been archived on 2026-10-11. You can view files and clone it. You cannot open issues or pull requests or push a commit.
Files
lightup/.gitlab-ci.yml
T
2022-02-13 22:30:20 +01:00

76 lines
1.8 KiB
YAML

stages: # List of stages for jobs, and their order of execution
- build
- test
- coverage
default:
tags:
- CREMI
build-job: # This job runs in the build stage, which runs first.
allow_failure: false
stage: build
script:
- mkdir -p build
- cd build
- cmake -DCMAKE_BUILD_TYPE=DEBUG ..
- make VERBOSE=ON -j 4 | tee ../build.log
artifacts:
expire_in: 10 minutes
name: "$CI_JOB_NAME-$CI_COMMIT_REF_NAME"
paths:
- build/
- build.log
test-v1-job: # This job runs in the test stage.
dependencies:
- build-job
stage: test # It only starts when the job in the build stage completes successfully.
script:
- cd build
- echo "Running tests V1..."
- ctest -R v1 | tee ../test-v1-job.log
artifacts:
expire_in: 10 minutes
paths:
- build/
- test-v2-job.log
test-v2-job: # This job runs in the test stage.
dependencies:
- build-job
stage: test # It only starts when the job in the build stage completes successfully.
script:
- cd build
- echo "Running tests V2..."
- ctest -R v2 | tee ../test-v2-job.log
artifacts:
expire_in: 10 minutes
paths:
- build/
- test-v2-job.log
### coverage
coverage-job:
stage: coverage
dependencies:
- test-v1-job
- test-v2-job
script:
- cd build
- make test
- gcovr --xml-pretty --exclude-unreachable-branches --print-summary -o coverage.xml --root ${CI_PROJECT_DIR}
coverage: /^\s*lines:\s*\d+.\d+\%/
artifacts:
name: ${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}-${CI_COMMIT_SHA}
expire_in: 2 days
reports:
cobertura: build/coverage.xml
### cleanup project for security issues
cleanup:
stage: .post
script:
- MYDIR=$(pwd) ; rm -rf $MYDIR ; mkdir $MYDIR
- ls $MYDIR
when: always