-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
208 lines (184 loc) · 6.29 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
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
image: mcr.microsoft.com/dotnet/sdk:3.1
stages:
- test
- pack
- integration-test
- deploy
test cli:
stage: test
before_script:
- 'dotnet tool install dotnet-reportgenerator-globaltool --tool-path dotnet-tools'
script:
- 'cd RobSharper.Ros.MessageCli.Tests'
- 'dotnet test --logger junit /p:CollectCoverage=true /p:CoverletOutputFormat=cobertura /p:CoverletOutput=TestResults/'
- '../dotnet-tools/reportgenerator -reports:TestResults/coverage.cobertura.xml -targetdir:TestResults/coverage-report -reporttypes:Html'
coverage: '/Total\s+\|\s+(\d{0,2}\.\d{1,2}%)/'
artifacts:
paths:
- 'RobSharper.Ros.MessageCli.Tests/TestResults/'
reports:
junit: 'RobSharper.Ros.MessageCli.Tests/TestResults/TestResults.xml'
cobertura: 'RobSharper.Ros.MessageCli.Tests/TestResults/coverage.cobertura.xml'
tags:
- docker-executor
# Create a versioned NuGet package
# This task is only executed for the branches develop and master as well as version tags
.nuget-pack:
stage: pack
script:
- 'export X_CI_VERSION=$(git describe | cut -c 2-)'
- 'echo .Net version: $(dotnet --version)'
- 'echo Packing version $X_CI_VERSION $X_BUILD_VERSION'
- 'cd RobSharper.Ros.MessageCli'
- 'dotnet pack -c Release -o ../nuget/$X_BUILD_VERSION $X_FRAMEWORK_COMPILER_FLAG -p:Version=$X_CI_VERSION -p:SymbolPackageFormat=snupkg --include-symbols'
artifacts:
paths:
- 'nuget'
tags:
- docker-executor
pack LATEST:
extends: .nuget-pack
image: mcr.microsoft.com/dotnet/sdk:5.0
variables:
X_BUILD_VERSION: 'latest'
X_FRAMEWORK_COMPILER_FLAG: '-p:FrameworkLatest=True'
pack PREVIEW:
extends: .nuget-pack
image: mcr.microsoft.com/dotnet/sdk:6.0
variables:
X_BUILD_VERSION: 'preview'
X_FRAMEWORK_COMPILER_FLAG: '-p:FrameworkPreview=True'
# Test package generation with built nuget global tool
.generate_msgs:
stage: integration-test
tags:
- docker-executor
script:
- 'export X_CI_VERSION=$(git describe | cut -c 2-)'
- 'export PATH="$PATH:/root/.dotnet/tools"'
- 'echo Generating .Net messages for ROS packages'
- 'echo RobSharper.Ros.MessageCli version: $X_CI_VERSION'
- 'echo .Net version: $(dotnet --version)'
- 'dotnet tool install --add-source ./nuget/$X_BUILD_VERSION -g RobSharper.Ros.MessageCli --version $X_CI_VERSION'
- 'dotnet rosmsg config-feeds add "Robotics BaGet" https://robotics-baget.joanneum.at/v3/index.json 3'
- 'dotnet rosmsg config-feeds'
- 'echo Building all valid message packages'
- 'dotnet rosmsg build ./RobSharper.Ros.MessageCli.Tests/TestPackages/valid ./ros-messages-nuget/all/$X_TFM --nupkg --namespace $X_NAMESPACE --codegenerator $X_CODEGENERATOR'
- 'echo Building common_msgs with explicit reference to std_msgs'
- 'dotnet rosmsg build ./RobSharper.Ros.MessageCli.Tests/TestPackages/valid/common_msgs ./ros-messages-nuget/common_msgs/$X_TFM --nupkg --namespace $X_NAMESPACE --codegenerator $X_CODEGENERATOR --required-packages ./RobSharper.Ros.MessageCli.Tests/TestPackages/valid/std_msgs'
- 'echo Building common_msgs with $ROS_PACKAGE_PATH'
- 'export ROS_PACKAGE_PATH=./RobSharper.Ros.MessageCli.Tests/TestPackages/valid/std_msgs'
- 'dotnet rosmsg build ./RobSharper.Ros.MessageCli.Tests/TestPackages/valid/common_msgs ./ros-messages-nuget/common_msgs__ros_package_path/$X_TFM --nupkg --namespace $X_NAMESPACE --codegenerator $X_CODEGENERATOR'
artifacts:
paths:
- ros-messages-nuget
expire_in: 1 week
test ROS.Net netcoreapp2.1:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:2.1
variables:
X_NAMESPACE: 'Uml.Robotics.Ros.Messages'
X_CODEGENERATOR: 'rosnet'
X_TFM: 'netcoreapp2.1'
X_BUILD_VERSION: 'latest'
test ROS.Net netcoreapp3.1:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:3.1
variables:
X_NAMESPACE: 'Uml.Robotics.Ros.Messages'
X_CODEGENERATOR: 'rosnet'
X_TFM: 'netcoreapp3.1'
X_BUILD_VERSION: 'latest'
test ROS.Net net5.0:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:5.0
variables:
X_NAMESPACE: 'Uml.Robotics.Ros.Messages'
X_CODEGENERATOR: 'rosnet'
X_TFM: 'net5.0'
X_BUILD_VERSION: 'latest'
test ROS.Net net6.0:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:6.0
variables:
X_NAMESPACE: 'Uml.Robotics.Ros.Messages'
X_CODEGENERATOR: 'rosnet'
X_TFM: 'net6.0'
X_BUILD_VERSION: 'preview'
test RobSharper netcoreapp2.1:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:2.1
variables:
X_NAMESPACE: 'RobSharper.Ros.Messages'
X_CODEGENERATOR: 'robsharper'
X_TFM: 'netcoreapp2.1'
X_BUILD_VERSION: 'latest'
test RobSharper netcoreapp3.1:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:3.1
variables:
X_NAMESPACE: 'RobSharper.Ros.Messages'
X_CODEGENERATOR: 'robsharper'
X_TFM: 'netcoreapp3.1'
X_BUILD_VERSION: 'latest'
test RobSharper net5.0:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:5.0
variables:
X_NAMESPACE: 'RobSharper.Ros.Messages'
X_CODEGENERATOR: 'robsharper'
X_TFM: 'net5.0'
X_BUILD_VERSION: 'latest'
test RobSharper net6.0:
extends: .generate_msgs
image: mcr.microsoft.com/dotnet/sdk:6.0
variables:
X_NAMESPACE: 'RobSharper.Ros.Messages'
X_CODEGENERATOR: 'robsharper'
X_TFM: 'net6.0'
X_BUILD_VERSION: 'preview'
# Deploy to JR BaGet server
# This is done for all pushes of version tags (v*) automatically
# Pushes to the master branch and web pipeline triggers must be deployed manually
.baget_base:
stage: deploy
only:
- develop
- master
- /^v.*$/
environment:
name: JR BaGet
url: https://robotics-baget.joanneum.at/
script:
- 'cd nuget/latest'
- 'dotnet nuget push *.nupkg -s $JR_BAGET_URL -k $JR_BAGET_API_KEY'
tags:
- docker-executor
baget auto:
extends: .baget_base
only:
- /^v.*$/
except:
- web
- schedules
baget manual:
extends: .baget_base
except:
- /^v.*$/
when: manual
# Deploy to NuGet.org
# This task has to be triggered manually
nuget.org:
stage: deploy
environment:
name: NuGet.org
url: https://www.nuget.org/
only:
- master
- /^v.*$/
script:
- 'cd nuget/latest'
- 'dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_ORG_API_KEY'
tags:
- docker-executor
when: manual