-
Notifications
You must be signed in to change notification settings - Fork 7
Expand file tree
/
Copy pathci.yml
More file actions
124 lines (120 loc) · 4.03 KB
/
ci.yml
File metadata and controls
124 lines (120 loc) · 4.03 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
trigger:
batch: true
branches:
include:
- main
paths:
exclude:
- README.md
pr: none
variables:
- name: "dotnet.sdk.version"
value: "10.0.x"
- name: "dotnet.cache.disable"
value: "false"
- name: "BuildConfiguration"
value: "Debug"
- name: "SolutionFile"
value: "Keeptrack.slnx"
- name: "TestProjects"
value: "test/*Tests/*.csproj"
stages:
- stage: "unit_testing"
displayName: "Unit testing"
jobs:
- job: "linux_unittests"
displayName: "Unit tests run on Linux"
pool:
vmImage: "ubuntu-latest"
steps:
- task: UseDotNet@2
displayName: "Use .NET Core SDK"
inputs:
packageType: "sdk"
version: $(dotnet.sdk.version)
- task: DotNetCoreCLI@2
displayName: "Build .NET solution"
inputs:
command: "build"
projects: "$(SolutionFile)"
arguments: "-c $(BuildConfiguration)"
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
- task: CmdLine@2
displayName: "Run .NET test projects"
inputs:
script: >
dotnet test
--configuration $(BuildConfiguration)
-- --filter-query "/[(Category=UnitTests)]"
env:
AllowedOrigins__0: "5207"
Features__IsScalarEnabled: true
Features__IsHttpsRedirectionEnabled: false
ASPNETCORE_ENVIRONMENT: Development
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
- stage: "integration_testing"
displayName: "Integration testing"
dependsOn: []
condition: eq(variables['RunIntegrationTestingStage'], true)
jobs:
- job: "windows_integrationtests"
displayName: "Windows CI"
pool:
vmImage: "windows-latest"
steps:
- task: UseDotNet@2
displayName: "Use .NET Core SDK"
inputs:
packageType: "sdk"
version: $(dotnet.sdk.version)
- task: PowerShell@2
displayName: "Start local MongoDB"
inputs:
targetType: "inline"
script: |
Write-Host "Starting MongoDB"
md log
md data
Start-Process -FilePath "mongod" -ArgumentList "--logpath log/mongod.log", "--dbpath data", "--port 27017" -WindowStyle Hidden
- task: DotNetCoreCLI@2
displayName: "Restore .NET packages"
inputs:
command: "restore"
projects: "$(SolutionFile)"
feedsToUse: "select"
noCache: $(dotnet.cache.disable)
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
- task: DotNetCoreCLI@2
displayName: "Build .NET solution"
inputs:
command: "build"
projects: "$(SolutionFile)"
arguments: "-c $(BuildConfiguration)"
env:
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
- task: DotNetCoreCLI@2
displayName: "Run .NET test projects"
inputs:
command: "test"
projects: "$(TestProjects)"
arguments: '--configuration $(BuildConfiguration) --report-xunit-trx --coverage --coverage-output-format cobertura -- --filter-query "/[(Category=UnitTests)|(Mode=Readonly)]"'
env:
AllowedOrigins__0: "5207"
Features__IsScalarEnabled: true
Features__IsHttpsRedirectionEnabled: false
ASPNETCORE_ENVIRONMENT: Development
DOTNET_CLI_TELEMETRY_OPTOUT: 1
DOTNET_NOLOGO: 1
- task: PublishBuildArtifacts@1
displayName: "Publish artifacts"
condition: failed()
inputs:
PathtoPublish: "$(Build.ArtifactStagingDirectory)"
ArtifactName: "drop"
publishLocation: "Container"