-
Notifications
You must be signed in to change notification settings - Fork 433
/
Copy path.gitlab-ci.yml
146 lines (132 loc) · 3.7 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
140
141
142
143
144
145
146
image: registry.gitlab.com/iniparser/docker-cmake:latest
variables:
GIT_SUBMODULE_STRATEGY: recursive
LD_LIBRARY_PATH: ${CI_BUILDS_DIR}/iniparser/iniparser/install/lib/
stages:
- build
- doc
- test
- win
- prepare
- release
build:
stage: build
script:
- mkdir build
- cd build
- cmake -DCMAKE_INSTALL_PREFIX=../install -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON -DBUILD_DOCS=ON ..
- make install
- tree -a .
artifacts:
paths:
- install/
- build/
pages:
stage: doc
dependencies:
- build
script:
- mv build/html/ public/
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH
test:
stage: test
script:
- pwd
- ls -l
- cd build/
- ctest --verbose
dependencies:
- build
memcheck:
stage: test
script:
- pwd
- ls -l
- cd build/
- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=255 ctest --verbose
dependencies:
- build
iniexample-memcheck:
stage: test
script:
- pwd
- tree
- cd install/share/doc/iniparser/examples/
- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=255 ./iniexample
dependencies:
- build
iniwrite-memcheck:
stage: test
script:
- pwd
- tree
- cd install/share/doc/iniparser/examples/
- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=255 ./iniwrite
dependencies:
- build
parse-memcheck:
stage: test
script:
- pwd
- tree
- cd install/share/doc/iniparser/examples/
- valgrind --leak-check=full --show-leak-kinds=all --track-origins=yes --error-exitcode=255 ./parse
dependencies:
- build
.shared_windows_runners:
tags:
- saas-windows-medium-amd64
win-build:
extends:
- .shared_windows_runners
stage: win
script:
- git clone https://github.com/tronkko/dirent.git
- mkdir build
- cd build
- cmake -DCMAKE_INCLUDE_PATH="../dirent/include" -DBUILD_TESTING=ON -DBUILD_EXAMPLES=ON ..
- cmake --build .
- Get-Location
- Get-ChildItem –Recurse
# due to the long provisioning time of the Windows runner, tests are
# executed in the same stage as the build
- ctest -C Debug --verbose
artifacts:
paths:
- build/
dependencies: []
prepare_job:
stage: prepare
image: alpine:latest
rules:
- if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
script:
- apk add curl jq
- 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG" | jq -r .notes > release_notes.md'
- 'curl -H "PRIVATE-TOKEN: $CI_API_TOKEN" -X POST "$CI_API_V4_URL/projects/$CI_PROJECT_ID/repository/changelog?version=$CI_COMMIT_TAG"'
artifacts:
paths:
- release_notes.md
release_job:
stage: release
image: registry.gitlab.com/gitlab-org/release-cli:latest
needs:
- job: prepare_job
artifacts: true
rules:
- if: '$CI_COMMIT_TAG =~ /^v?\d+\.\d+\.\d+$/'
script:
- echo "Creating release"
release:
name: 'Release $CI_COMMIT_TAG'
description: release_notes.md
tag_name: '$CI_COMMIT_TAG'
ref: '$CI_COMMIT_SHA'
#assets:
# links:
# - name: 'Container Image $CI_COMMIT_TAG'
# url: "https://$CI_REGISTRY_IMAGE/$CI_COMMIT_REF_SLUG:$CI_COMMIT_SHA"