This repository has been archived by the owner on Dec 8, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 26
/
appveyor.yml
52 lines (47 loc) · 2.06 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
#---------------------------------#
# environment configuration #
#---------------------------------#
version: 1.0.0.{build}
install:
- ps: |
Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force
Install-Module -Name Pester -Repository PSGallery -Force
# generate password
$randomObj = New-Object System.Random
$password = ""
1..(Get-Random -Minimum 15 -Maximum 126) | ForEach { $password = $password + [char]$randomObj.next(45,126) }
# change password
$objUser = [ADSI]("WinNT://$($env:computername)/appveyor")
$objUser.SetPassword($password)
$global:AppveyorRemotelyUserName = 'appveyor'
$global:AppveyorRemotelyPassword = $password
#---------------------------------#
# build configuration #
#---------------------------------#
build: false
#---------------------------------#
# test configuration #
#---------------------------------#
test_script:
- ps: |
Import-Module .\Remotely.psd1
$testResultsFile = ".\TestsResults.xml"
$res = Invoke-Pester -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path $testResultsFile))
if ($res.FailedCount -gt 0) {
throw "$($res.FailedCount) tests failed."
}
#---------------------------------#
# deployment configuration #
#---------------------------------#
# scripts to run before deployment
deploy_script:
- ps: |
# Creating project artifact
$stagingDirectory = (Resolve-Path ..).Path
$manifest = Join-Path $pwd "Remotely.psd1"
#(Get-Content $manifest -Raw).Replace("1.0.0", $env:APPVEYOR_BUILD_VERSION) | Out-File $manifest
$zipFilePath = Join-Path $stagingDirectory "$(Split-Path $pwd -Leaf).zip"
Add-Type -assemblyname System.IO.Compression.FileSystem
[System.IO.Compression.ZipFile]::CreateFromDirectory($pwd, $zipFilePath)
Push-AppveyorArtifact $zipFilePath