-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.gitlab-ci.yml
133 lines (122 loc) · 3.5 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
include:
- project: sequence/templates/cicd
file: .gitlab-ci.windows.yml
stages:
- build
- test
- integration
- quality
- package
- sign
- push
workflow:
rules:
- if: $CI_COMMIT_BRANCH == 'master'
- if: $CI_MERGE_REQUEST_ID
- if: $CI_COMMIT_BRANCH !~ /^\d+-/
- if: $CI_COMMIT_TAG
- if: $CI_PIPELINE_SOURCE == 'schedule'
variables:
PACKAGE_NAME_NUGET: Sequence.Connectors.Nuix
PACKAGE_NAME_DLL: Sequence.Connectors.Nuix
GIT_SUBMODULE_STRATEGY: normal
PUBLISH_CONNECTOR: 1
PUBLISH_NUGETORG: 1
test dev:
script:
- dotnet test --no-build --configuration $CONFIG -v normal
--filter "Category!=Integration&Category!=IntegrationShort"
--collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory ./
integration short:
stage: integration
extends:
- .default_before_script
needs: []
tags:
- nuix
variables:
CONFIG: $CONFIG_DEV
NUGET_PROJECT_ID: $NUGET_PROJECT_ID_DEV
NUGET_USERNAME: $NUGET_USER_DEV
NUGET_TOKEN: $NUGET_TOKEN_DEV
after_script:
- dotnet nuget remove source sequence
script:
- dotnet restore --packages ./packages
- dotnet test --no-restore --configuration $CONFIG -v normal
--filter "Category!=Integration"
--collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory ./
artifacts:
paths:
- '*/coverage.cobertura.xml'
expire_in: 2 hours
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
when: never
# - if: $CI_COMMIT_BRANCH == 'master'
- if: ¬_release $CI_COMMIT_TAG !~ /^v(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?$/i
when: manual
allow_failure: true
integration full:
extends:
- integration short
script:
- dotnet restore --packages ./packages
- dotnet test --no-restore --configuration $CONFIG -v normal
--collect:"XPlat Code Coverage" --settings coverlet.runsettings --results-directory ./
- |
dotnet test --no-restore --configuration $CONFIG --list-tests |
ForEach-Object {
if ($_ -match 'caseName: "(.+?)\((\d+\.\d+)\)') {
[pscustomobject]@{ Name = $Matches[1] ; Version = $Matches[2] }
}
} | group Version | select Name, Count
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
- if: $CI_COMMIT_BRANCH == 'master'
when: manual
allow_failure: true
- if: *not_release
when: manual
allow_failure: true
# integration short release:
# extends:
# - integration short
# - .rules_release
# variables:
# CONFIG: $CONFIG_RELEASE
# NUGET_PROJECT_ID: $NUGET_PROJECT_ID_RELEASE
# NUGET_USERNAME: $NUGET_USER_PROD
# NUGET_TOKEN: $NUGET_TOKEN_PROD
push to nuget dev:
rules:
- if: $CI_PIPELINE_SOURCE == 'schedule'
when: never
- if: $CI_COMMIT_BRANCH == 'master'
- if: *not_release
when: manual
allow_failure: true
# Skipping mutation testing as Stryker currently doesn't support filters
mutation testing:
rules:
- when: never
code coverage dev:
needs:
- job: test dev
optional: false
- job: version check dev
optional: false
- job: integration short
optional: true
- job: integration full
optional: true
code coverage release:
needs:
- job: test release
optional: false
- job: version check release
optional: false
- job: integration short
optional: true
- job: integration full
optional: true