forked from dsccommunity/xPSDesiredStateConfiguration
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
144 lines (125 loc) · 3.78 KB
/
appveyor.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
#---------------------------------#
# environment configuration #
#---------------------------------#
version: 6.0.{build}.0
environment:
gallery_api:
secure: 9ekJzfsPCDBkyLrfmov83XbbhZ6E2N3z+B/Io8NbDetbHc6hWS19zsDmy7t0Vvxv
# The job where deploy step should run (normally the last job)
DeployInJobNumber: 5
# The images that will be used when building the job matrix.
image:
- Visual Studio 2017
- Visual Studio 2015
# The configuration that will be used when building the job matrix.
# Meta = Test Framework Common Test
# Unit = Module Unit Tests.
# Integration = Module Integration Tests.
configuration:
- Meta
- Unit
- Integration
# - If one job in the matrix fails, the build will stop (fast_finish).
# - The jobs that will excluded based on the combination of configuration name
# and image name. This will make sure the meta tests (common tests) are only
# run on one of the images.
matrix:
fast_finish: true
exclude:
- configuration: Meta
image: Visual Studio 2015
install:
- git clone https://github.com/PowerShell/DscResource.Tests
- ps: |
$moduleName = 'xPSDesiredStateConfiguration'
Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
Invoke-AppveyorInstallTask
#---------------------------------#
# build configuration #
#---------------------------------#
build: false
#---------------------------------#
# test configuration #
#---------------------------------#
# This will build the job matrix (exception is what is excluded from the matrix
# above). The jobs will be order by the order of key 'configuration:' and then
# by the key 'images:'.
#
# Job 1: Run meta test (common tests) on image Visual Studio 2017.
# Job 2: Run unit tests on image Visual Studio 2017, including Codecov report.
# Job 3: Run integration tests on image Visual Studio 2017.
# Job 4: Run unit tests on image Visual Studio 2015, without Codecov report.
# Job 5: Run integration tests on image Visual Studio 2015.
for:
-
# Job 1.
matrix:
only:
- configuration: Meta
test_script:
- ps: |
Invoke-AppveyorTestScriptTask `
-Type 'Default' `
-ExcludeTag @()
-
# Job 3 and job 5.
matrix:
only:
- configuration: Integration
environment:
SkipAllCommonTests: True
test_script:
- ps: |
Invoke-AppveyorTestScriptTask `
-Type 'Default' `
-DisableConsistency `
-ExcludeTag @()
-
# Job 4.
matrix:
only:
- configuration: Unit
image: Visual Studio 2015
environment:
SkipAllCommonTests: True
test_script:
- ps: |
Invoke-AppveyorTestScriptTask `
-Type 'Default' `
-CodeCoverage `
-ExcludeTag @()
-
# Job 2.
matrix:
only:
- configuration: Unit
image: Visual Studio 2017
environment:
SkipAllCommonTests: True
test_script:
- ps: |
Invoke-AppveyorTestScriptTask `
-Type 'Default' `
-CodeCoverage `
-CodeCovIo `
-ExcludeTag @()
# Runs for all jobs.
after_test:
- ps: |
Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
Invoke-AppveyorAfterTestTask `
-ResourceModuleName $moduleName
#---------------------------------#
# deployment configuration #
#---------------------------------#
# Runs only in a branch (not in PR).
deploy_script:
- ps: |
if ($env:APPVEYOR_JOB_NUMBER -eq $env:DeployInJobNumber)
{
Invoke-AppVeyorDeployTask
}
else
{
Write-Verbose -Message ('Skipping deploy step. Deploy step was requested to run in job number {0}. Current job number is {1}.' -f $env:DeployInJobNumber, $env:APPVEYOR_JOB_NUMBER) -Verbose
}