-
Notifications
You must be signed in to change notification settings - Fork 0
/
.gitlab-ci.yml
151 lines (129 loc) · 3.58 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
image: mcr.microsoft.com/dotnet/sdk:6.0
stages:
- build
- test
- publish
- test-templates
- deploy
build Solution:
stage: build
script:
- 'dotnet build RobSharper.Ros.IntegROS.sln'
tags:
- docker-executor
.test:
stage: test
script:
- 'cd $PROJECT_NAME'
- 'dotnet nuget add source https://robotics-baget.joanneum.at/v3/index.json -n robotics-baget'
- 'dotnet build -p:JRINTERNAL=True'
- 'dotnet test --no-build --verbosity normal --logger junit -p:CollectCoverage=true -p:CoverletOutputFormat=cobertura -p:CoverletOutput=TestResults/'
coverage: '/Total\s+\|\s+(\d{0,2}\.\d{1,2}%)/'
artifacts:
paths:
- '$PROJECT_NAME/TestResults'
reports:
junit: '$PROJECT_NAME/TestResults/TestResults.xml'
cobertura: '$PROJECT_NAME/TestResults/coverage.cobertura.xml'
tags:
- docker-executor
test IntegROS:
extends: .test
variables:
PROJECT_NAME: 'RobSharper.Ros.IntegROS.Tests'
test Expectations:
extends: .test
variables:
PROJECT_NAME: 'RobSharper.Ros.IntegROS.Tests.Expectations'
test IntegROS without UML Robotics:
extends: .test
variables:
PROJECT_NAME: 'RobSharper.Ros.IntegROS.Tests.WithoutUmlRoboticsSupport'
test IntegROS with UML Robotics:
extends: .test
variables:
PROJECT_NAME: 'RobSharper.Ros.IntegROS.Tests.WithUmlRoboticsSupport'
run examples TurtleSim:
extends: .test
variables:
PROJECT_NAME: 'Examples.TurtleSimTests'
run examples Fibonacci Action:
extends: .test
variables:
PROJECT_NAME: 'Examples.FibonacciActionTests'
Coverage Report:
stage: publish
before_script:
- 'dotnet tool install dotnet-reportgenerator-globaltool --tool-path dotnet-tools'
script:
- 'dotnet-tools/reportgenerator -reports:*/TestResults/coverage.cobertura.xml -targetdir:coverage-report -reporttypes:Html'
artifacts:
paths:
- 'coverage-report'
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: publish
script:
- 'export X_CI_VERSION=$(git describe | cut -c 2-)'
- 'echo Publishing version $X_CI_VERSION'
- 'cd RobSharper.Ros.IntegROS'
- 'dotnet pack -c Release -o ../nuget/ -p:Version=$X_CI_VERSION -p:SymbolPackageFormat=snupkg --include-symbols'
artifacts:
paths:
- 'nuget'
- 'RobSharper.Ros.IntegROS/bin/Release/'
tags:
- docker-executor
# Include Packing and Testing jobs for dotnet new templates
include: '/ProjectTemplates/.gitlab-ci.templates.yml'
# Deploy to JR BaGet server
# This is done automatically for version tags (v*)
# For all other commits manual deployments can be triggered
.baget_base:
stage: deploy
dependencies:
- nuget-pack
- templates pack
environment:
name: JR BaGet
url: https://robotics-baget.joanneum.at/
script:
- 'cd nuget'
- '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 and is only allowed
# for version tags (v*) and the master branch
nuget.org:
stage: deploy
dependencies:
- nuget-pack
- templates pack
environment:
name: NuGet.org
url: https://www.nuget.org/
only:
- master
- /^v.*$/
script:
- 'cd nuget'
- 'dotnet nuget push *.nupkg -s https://api.nuget.org/v3/index.json -k $NUGET_ORG_API_KEY'
tags:
- docker-executor
when: manual