-
Notifications
You must be signed in to change notification settings - Fork 21
/
.gitlab-ci.yml
139 lines (128 loc) · 3.67 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
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
stages:
- test
- lint
- docs
- collect
- deploy
- release
variables:
MACOSX_DEPLOYMENT_TARGET: "12.7"
### Prototype build jobs ###
.build_script: &build_script
- mkdir -p build/
- cd build/
- echo $CMAKE_CMD
- $CMAKE_CMD
- ninja
.test_script: &test_script
- ctest -V
.build:
variables:
EXTRA_CMAKE_FLAGS: ""
before_script:
- export CMAKE_CMD="cmake -GNinja $EXTRA_CMAKE_FLAGS .."
script:
- *build_script
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
.build_and_test:
extends: .build
script:
- *build_script
- *test_script
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
artifacts:
name: "${CI_BUILD_STAGE}_${CI_BUILD_REF_NAME}"
paths:
- build/Testing/Temporary/
when: always
expire_in: 2 weeks
### Debian ###
test:debian:static:
extends: .build_and_test
stage: test
needs: []
image: ghcr.io/educelab/ci-docker:static.12.1
variables:
CMAKE_PREFIX_PATH: "/usr/local/Qt-6.7.2/"
EXTRA_CMAKE_FLAGS: "-DVC_BUILD_ACVD=ON -DVC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVC_BUILD_TESTS=ON"
tags:
- docker
test:debian:dynamic:
extends: .build_and_test
stage: test
needs: []
image: ghcr.io/educelab/ci-docker:dynamic.12.1
variables:
CMAKE_PREFIX_PATH: "/usr/local/Qt-6.7.2/"
EXTRA_CMAKE_FLAGS: "-DVC_BUILD_ACVD=ON -DBUILD_SHARED_LIBS=ON -DVC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVC_BUILD_TESTS=ON"
tags:
- docker
### macOS ###
test:macos:static:
extends: .build_and_test
stage: test
needs: []
variables:
CMAKE_PREFIX_PATH: "/usr/local/educelab/vc-deps-1.9.0-static-debug:/usr/local/Qt/6.7.2/macos/lib/cmake/"
EXTRA_CMAKE_FLAGS: "-DVC_BUILD_ACVD=ON -DVC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVC_BUILD_TESTS=ON"
tags:
- macos
- test
test:macos:dynamic:
extends: .build_and_test
stage: test
needs: []
variables:
CMAKE_PREFIX_PATH: "/usr/local/educelab/vc-deps-1.9.0-dynamic-debug:/usr/local/Qt/6.7.2/macos/lib/cmake/"
EXTRA_CMAKE_FLAGS: "-DVC_BUILD_ACVD=ON -DBUILD_SHARED_LIBS=ON -DVC_BUILD_EXAMPLES=ON -DCMAKE_BUILD_TYPE=RelWithDebInfo -DVC_BUILD_TESTS=ON"
tags:
- macos
- test
### Extra checks ###
lint:clang-format:
stage: lint
needs: []
before_script:
- git fetch --all
script:
- utils/scripts/clang-format.py --print-output
allow_failure: true
tags:
- macos
- lint
rules:
- if: '$CI_PIPELINE_SOURCE == "merge_request_event"'
- if: '$CI_COMMIT_BRANCH && $CI_OPEN_MERGE_REQUESTS'
when: never
- if: '$CI_COMMIT_BRANCH'
### Documentation ###
pages:
stage: docs
needs: []
image: ghcr.io/educelab/ci-docker:static.12.1
before_script:
- apt-get -y update
- apt-get install --fix-missing --fix-broken -y doxygen graphviz
script:
- mkdir -p build/
- mkdir -p public/
- cmake -S . -B build/ -DVC_BUILD_DOCS=ON -DVC_BUILD_APPS=OFF -DVC_BUILD_UTILS=OFF
- cmake --build build/ --target docs
- mv build/docs/html/ public/docs/
artifacts:
paths:
- public
expire_in: 30 days
allow_failure: true
tags:
- docker
rules:
- if: '$CI_COMMIT_BRANCH == "develop"'