forked from dsccommunity/SqlServerDsc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
appveyor.yml
130 lines (112 loc) · 4.57 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
#---------------------------------#
# environment configuration #
#---------------------------------#
version: 9.0.{build}.0
environment:
gallery_api:
secure: 9ekJzfsPCDBkyLrfmov83XbbhZ6E2N3z+B/Io8NbDetbHc6hWS19zsDmy7t0Vvxv
# The job where deploy step should run (normally the last job)
DeployInJobNumber: 4
# The image that will be used when building the job matrix.
image: Visual Studio 2017
# 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_SQL2016
- Integration_SQL2017
install:
- git clone https://github.com/PowerShell/DscResource.Tests
- ps: Write-Verbose -Message "PowerShell version $($PSVersionTable.PSVersion)" -Verbose
- ps: Import-Module "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
- ps: Invoke-AppveyorInstallTask
#---------------------------------#
# build configuration #
#---------------------------------#
build: false
#---------------------------------#
# test configuration #
#---------------------------------#
# This will build the job matrix
#
# 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.
for:
-
matrix:
only:
- configuration: Meta
test_script:
- ps: |
Invoke-AppveyorTestScriptTask -ExcludeTag @()
-
matrix:
only:
- configuration: Integration_SQL2016
- configuration: Integration_SQL2017
environment:
SkipAllCommonTests: True
test_script:
- ps: |
Write-Verbose -Message '--- WORKAROUND FOR ISSUE #239 AND ISSUE #774 ---' -Verbose
$sqlModules = Get-Module -ListAvailable -Name 'sql*'
$sqlUniqueModulePath = Split-Path -Path (Split-Path $sqlModules.Path -Parent) -Parent | Sort-Object -Unique
$sqlUniqueModulePath | ForEach-Object -Process {
$newFolderName = '{0}.old' -f (Split-Path -Path $_ -Leaf)
Write-Verbose ('Renaming ''{0}'' to ''..\{1}''' -f $_, $newFolderName) -Verbose
Rename-Item $_ -NewName $newFolderName -Force
}
Write-Verbose -Message '' -Verbose
# Workaround for issue #798
Write-Verbose -Message '--- WORKAROUND FOR ISSUE #798 ---' -Verbose
$azureModules = Get-Module -ListAvailable -Name 'Azure*' | Where-Object -FilterScript { $_.Name -notlike 'AzureRm*' }
$azureUniqueModulePath = Split-Path -Path (Split-Path $azureModules.Path -Parent) -Parent | Sort-Object -Unique
$azureUniqueModulePath | ForEach-Object -Process {
$newFolderName = '{0}.old' -f (Split-Path -Path $_ -Leaf)
Write-Verbose ('Renaming ''{0}'' to ''..\{1}''' -f $_, $newFolderName) -Verbose
Rename-Item $_ -NewName $newFolderName -Force
}
Write-Verbose -Message '' -Verbose
Invoke-AppveyorTestScriptTask -ExcludeTag @() -RunTestInOrder
-
matrix:
only:
- configuration: Unit
environment:
SkipAllCommonTests: True
test_script:
- ps: |
# Workaround for issue #239 and issue #774.
Write-Verbose -Message '--- WORKAROUND FOR ISSUE #239 AND ISSUE #774 ---' -Verbose
$sqlModules = Get-Module -ListAvailable -Name 'sql*'
$sqlUniqueModulePath = Split-Path -Path (Split-Path $sqlModules.Path -Parent) -Parent | Sort-Object -Unique
$sqlUniqueModulePath | ForEach-Object -Process {
$newFolderName = '{0}.old' -f (Split-Path -Path $_ -Leaf)
Write-Verbose ('Renaming ''{0}'' to ''..\{1}''' -f $_, $newFolderName) -Verbose
Rename-Item $_ -NewName $newFolderName -Force
}
Write-Verbose -Message '' -Verbose
Invoke-AppveyorTestScriptTask -CodeCoverage -CodeCovIo -ExcludeTag @() -RunTestInOrder
# Runs for all jobs.
after_test:
- ps: |
Import-Module -Name "$env:APPVEYOR_BUILD_FOLDER\DscResource.Tests\AppVeyor.psm1"
Invoke-AppveyorAfterTestTask
#---------------------------------#
# 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
}