-
Notifications
You must be signed in to change notification settings - Fork 5
/
.gitlab-ci.yml
75 lines (65 loc) · 2.09 KB
/
.gitlab-ci.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
stages:
- test
- publish
- trigger_prep
- trigger
include:
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-github-status-updates.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-commits.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-license.yml'
- project: 'Northern.tech/Mender/mendertesting'
file: '.gitlab-ci-check-c++.yml'
variables:
GIT_SUBMODULE_STRATEGY: recursive
.test:static-template:
tags:
- mender-qa-worker-generic-light
stage: test
image: debian:11
before_script:
- apt update && apt install -yyq g++ cmake git make lcov pkg-config
test:no-tests:
extends: .test:static-template
script:
- cmake -D BUILD_TESTS=OFF .
- make --jobs=$(nproc --all) --keep-going
test:unit:
extends: .test:static-template
script:
- cmake -D COVERAGE=ON .
- make --jobs=$(nproc --all) --keep-going coverage
artifacts:
expire_in: 2w
reports:
junit: reports/*.xml
paths:
- tests/coverage.lcov
publish:tests:
tags:
- mender-qa-worker-generic-light
stage: publish
image: python:3.11
dependencies:
- test:unit
before_script:
# Install dependencies
- apt update && apt install -yyq lcov
- pip install cpp-coveralls pyyaml
# eddyxu/cpp-coveralls appears dead, but there doesn't seem to be an
# alternative. Use this patch from someone who attempted to fix it. An
# alternative to this is to use pyyaml<6, but it's better to use just one
# old component than two.
- curl -f https://github.com/eddyxu/cpp-coveralls/commit/067c837c04e039e8c70aa53bceda1cded6751408.patch | patch -f /usr/local/lib/python3.11/site-packages/cpp_coveralls/__init__.py
- export CI_BRANCH=$CI_COMMIT_BRANCH
# "TRAVIS_JOB_ID" is hardcoded in cpp-coveralls, but it is semantically the
# same as "CI_JOB_ID" would be.
- export TRAVIS_JOB_ID=$CI_PIPELINE_ID
script:
- 'echo "service_name: gitlab-ci" > .coveralls.yml'
- cpp-coveralls
--repo-token ${COVERALLS_TOKEN}
--no-gcov
--lcov-file tests/coverage.lcov