-
Notifications
You must be signed in to change notification settings - Fork 2
/
.gitlab-ci.yml
51 lines (45 loc) · 969 Bytes
/
.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
image: mcr.microsoft.com/dotnet/sdk:5.0-alpine
stages:
- build
- test-pack
- deploy
variables:
CONFIGURATION: Release
GIT_STRATEGY: clone
build:
stage: build
script:
- dotnet build -property:ContinuousIntegrationBuild=true
cache: &cache_template
key: ${CI_COMMIT_REF_SLUG}
paths:
- ./src/*/bin/*
- ./unit/*
policy: push
test:
stage: test-pack
script:
- dotnet test --logger 'junit;MethodFormat=Class;FailureBodyFormat=Verbose' --collect 'XPlat Code Coverage'
cache:
<<: *cache_template
policy: pull
artifacts:
reports:
cobertura: ./unit/TestResults/**/coverage.cobertura.xml
junit: ./unit/TestResults/TestResults.xml
pack:
stage: test-pack
script:
- dotnet pack --output "$(pwd)/dist/"
cache:
<<: *cache_template
policy: pull
artifacts:
paths:
- ./dist/
deploy:
stage: deploy
script:
- dotnet nuget push --api-key "${NUGET_API_KEY}" ./dist/*.nupkg
only:
- main