-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path.gitlab-ci.yml
More file actions
214 lines (194 loc) · 4.96 KB
/
.gitlab-ci.yml
File metadata and controls
214 lines (194 loc) · 4.96 KB
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
209
210
211
212
213
214
image: mcr.microsoft.com/dotnet/sdk:10.0
variables:
TZ: "Europe/Berlin"
LANG: "de"
stages:
- build
- test
- deploy
default-build:
stage: build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG == null
script:
- dotnet build -c Debug --nologo
- mkdir ./artifacts
- shopt -s globstar
- mv ./**/*.nupkg ./artifacts/ || true
- mv ./**/*.snupkg ./artifacts/ || true
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 days
default-test:
stage: test
dependencies:
- default-build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG == null
coverage: /Branch coverage[\s\S].+%/
before_script:
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
script:
- dotnet test -c Debug --nologo /p:CoverletOutputFormat=Cobertura
- /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary"
- cat /reports/Summary.txt
artifacts:
when: always
reports:
coverage_report:
coverage_format: cobertura
path: ./**/coverage.cobertura.xml
default-deploy:
stage: deploy
dependencies:
- default-build
- default-test
tags:
- docker
- lnx
- server
rules:
- if: $CI_COMMIT_TAG == null
script:
- dotnet nuget push -k $BAGET_APIKEY -s https://nuget.am-wd.de/v3/index.json --skip-duplicate artifacts/*.nupkg || true
core-build:
stage: build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG =~ /^v[0-9.]+/
script:
- dotnet build -c Release --nologo src/Cloudflare/Cloudflare.csproj
- mkdir ./artifacts
- shopt -s globstar
- mv ./**/*.nupkg ./artifacts/ || true
- mv ./**/*.snupkg ./artifacts/ || true
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 days
core-test:
stage: test
dependencies:
- core-build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG =~ /^v[0-9.]+/
before_script:
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
script:
- dotnet test -c Release --nologo /p:CoverletOutputFormat=Cobertura test/Cloudflare.Tests/Cloudflare.Tests.csproj
- /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" "-reportType:TextSummary"
- cat /reports/Summary.txt
artifacts:
when: always
reports:
coverage_report:
coverage_format: cobertura
path: ./**/coverage.cobertura.xml
core-deploy:
stage: deploy
dependencies:
- core-build
- core-test
tags:
- docker
- lnx
- server
rules:
- if: $CI_COMMIT_TAG =~ /^v[0-9.]+/
script:
- dotnet nuget push -k $NUGET_APIKEY -s https://api.nuget.org/v3/index.json --skip-duplicate artifacts/*.nupkg || true
extensions-build:
stage: build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG =~ /^[a-z]+\/v[0-9.]+/
script:
- dotnet build -c Release --nologo
- mkdir ./artifacts
- shopt -s globstar
- mv ./**/*.nupkg ./artifacts/ || true
- mv ./**/*.snupkg ./artifacts/ || true
artifacts:
paths:
- artifacts/*.nupkg
- artifacts/*.snupkg
expire_in: 1 days
extensions-test:
stage: test
dependencies:
- extensions-build
tags:
- docker
- lnx
- 64bit
rules:
- if: $CI_COMMIT_TAG =~ /^[a-z]+\/v[0-9.]+/
before_script:
- dotnet tool install dotnet-reportgenerator-globaltool --tool-path /dotnet-tools
script:
- dotnet test -c Release --nologo /p:CoverletOutputFormat=Cobertura
- /dotnet-tools/reportgenerator "-reports:${CI_PROJECT_DIR}/**/coverage.cobertura.xml" "-targetdir:/reports" -reportType:TextSummary
- cat /reports/Summary.txt
artifacts:
when: always
reports:
coverage_report:
coverage_format: cobertura
path: ./**/coverage.cobertura.xml
extensions-deploy:
stage: deploy
dependencies:
- extensions-build
- extensions-test
tags:
- docker
- lnx
- server
rules:
- if: $CI_COMMIT_TAG =~ /^[a-z]+\/v[0-9.]+/
script:
- dotnet nuget push -k $NUGET_APIKEY -s https://api.nuget.org/v3/index.json --skip-duplicate artifacts/*.nupkg || true
publish-docs:
variables:
DOCFX_SOURCE_REPOSITORY_URL: "https://github.com/AM-WD/cloudflare-api"
stage: deploy
tags:
- docker
- lnx
- server
rules:
- if: $CI_COMMIT_TAG != null
before_script:
- apt-get update
- apt-get -y install zip unzip
- dotnet tool install docfx --tool-path /dotnet-tools
script:
# Build the docs
- dotnet build -c Release --nologo
- /dotnet-tools/docfx metadata docs/docfx.json
- /dotnet-tools/docfx build docs/docfx.json
# Deploy the docs
- cd docs/_site
- zip -r ../docs.zip *
- curl --user "$DOCS_DEPLOY_USER:$DOCS_DEPLOY_PASS" -F docs=cloudflare -F dump=@../docs.zip "$DOCS_DEPLOY_URL"