This repository has been archived by the owner on Jun 13, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 138
/
appveyor.yml
89 lines (72 loc) · 2.72 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
version: 1.1.3.{build}
environment:
matrix:
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PowerShellEdition: Desktop
TestCategory: DSC
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PowerShellEdition: Desktop
- APPVEYOR_BUILD_WORKER_IMAGE: WMF 5
PowerShellEdition: Desktop
- APPVEYOR_BUILD_WORKER_IMAGE: WMF 4
PowerShellEdition: Desktop
- APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2017
PowerShellEdition: Core
configuration: Release
platform: Any CPU
# clone directory
clone_folder: c:\projects\powershellget
init:
- ps: iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/appveyor/ci/master/scripts/enable-rdp.ps1'))
# Install Pester and PackageManagement modules
install:
- ps: |
# Some AppVeyor OS images (ex: VS 2017) are pre-installed with the Azure modules using PowerShellGet cmdlets.
# These pre-installed modules are causing prompts during Update-Module tests as the PSGallery repository is untrusted by design.
# Below command removes the PSGetModuleInfo.xml files created by the Install-Module cmdlet.
Get-Module -ListAvailable | ForEach-Object {Join-Path -Path $_.ModuleBase -ChildPath 'PSGetModuleInfo.xml'} | Where-Object {Test-Path -Path $_ -PathType Leaf} | Remove-Item -Force
Import-Module .\tools\build.psm1
Install-Dependencies
Update-ModuleManifestFunctions
Publish-ModuleArtifacts
Install-PublishedModule
# to run your custom scripts instead of automatic MSBuild
#build_script:
# to disable automatic builds
build: off
# branches to build
branches:
# allowlist
only:
- master
- development
# Run Pester tests and store the results
test_script:
- ps: |
Invoke-PowerShellGetTest
for:
# Only run for jobs where TestCategory is 'DSC'.
-
matrix:
only:
- TestCategory: DSC
environment:
gallery_api:
secure: 9ekJzfsPCDBkyLrfmov83XbbhZ6E2N3z+B/Io8NbDetbHc6hWS19zsDmy7t0Vvxv
install:
- git clone https://github.com/PowerShell/DscResource.Tests %APPVEYOR_BUILD_FOLDER%\DSC\DscResource.Tests
- ps: |
Import-Module .\tools\build.psm1
Invoke-DscPowerShellGetAppVeyorInstallTask
test_script:
- ps: Invoke-DscPowerShellGetAppVeyorTestTask
deploy_script:
- ps: Invoke-DscPowerShellGetAppVeyorDeployTask
# Upload the project along with TestResults as a zip archive
on_finish:
- ps: |
$zipFile = ".\dist\PowerShellGet.zip"
Push-AppveyorArtifact $zipFile
Get-ChildItem -Path .\Tests\ -Filter 'TestResults*.xml' -File | ForEach-Object {
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", "$($_.FullName)")
}