Skip to content

Commit aee20b1

Browse files
committed
Add gitlab CI
Signed-off-by: Thomas Keller <[email protected]>
1 parent 2397e25 commit aee20b1

File tree

1 file changed

+75
-0
lines changed

1 file changed

+75
-0
lines changed

.gitlab-ci.yml

Lines changed: 75 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,75 @@
1+
---
2+
default:
3+
image: mcr.microsoft.com/devcontainers/cpp:1-debian-12
4+
5+
stages:
6+
- build
7+
- test
8+
- deploy
9+
10+
include:
11+
- template: Jobs/Code-Quality.gitlab-ci.yml
12+
- component: $CI_SERVER_FQDN/devminds-ch/gitlab-component-clang-format/gitlab-component-clang-format@main
13+
14+
build-project:
15+
stage: build
16+
before_script:
17+
- git submodule update --init --recursive
18+
script:
19+
- ./tools/build-cmake-target.sh gcc-release cplusplus_training_project
20+
artifacts:
21+
paths:
22+
- build/bin
23+
expire_in: 1 week
24+
25+
build-unit-tests:
26+
stage: build
27+
before_script:
28+
- git submodule update --init --recursive
29+
script:
30+
- ./tools/build-cmake-target.sh gcc-coverage calculate_test
31+
artifacts:
32+
paths:
33+
- build/
34+
expire_in: 1 week
35+
36+
build-documentation:
37+
stage: build
38+
before_script:
39+
- git submodule update --init --recursive
40+
- apt update && apt install -y doxygen
41+
script:
42+
- ./tools/build-docs.sh
43+
artifacts:
44+
paths:
45+
- build/html/
46+
expire_in: 1 week
47+
48+
code_quality:
49+
when: manual
50+
51+
run-unit-tests:
52+
stage: test
53+
before_script:
54+
- apt update && apt install -y gcovr
55+
script:
56+
- ./tools/run-test.sh build/gcc-coverage/bin/calculate_test build/gcc
57+
coverage: /^\s*lines:\s*\d+.\d+\%/
58+
artifacts:
59+
expire_in: 1 week
60+
reports:
61+
junit: build/gcc/test-report.xml
62+
coverage_report:
63+
coverage_format: cobertura
64+
path: build/gcc/test-coverage.xml
65+
66+
pages:
67+
stage: deploy
68+
script:
69+
- mv build/html/ public/
70+
environment:
71+
name: "Pages production"
72+
url: "${CI_PAGES_URL}"
73+
artifacts:
74+
paths:
75+
- public/

0 commit comments

Comments
 (0)