Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commite6d5e1f

Browse files
committed
Fix appveyor.yml
1 parent61008ba commite6d5e1f

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

‎appveyor.yml‎

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
#---------------------------------#
2+
# environment configuration #
3+
#---------------------------------#
4+
version:1.0.{build}
5+
image:WMF 5
6+
7+
#---------------------------------#
8+
# install configuration #
9+
#---------------------------------#
10+
install:
11+
-ps:|
12+
Write-Host "Install prerequisites" -ForegroundColor Yellow
13+
$null = Install-PackageProvider -Name NuGet -MinimumVersion 2.8.5.201 -Force -ErrorAction Stop
14+
Install-Module -Name PSScriptAnalyzer -Repository PSGallery -Force -ErrorAction Stop
15+
Install-Module -Name Pester -Repository PSGallery -Force -ErrorAction Stop
16+
# Validate
17+
$RequiredModules = 'PSScriptAnalyzer','Pester'
18+
$InstalledModules = Get-Module -Name $RequiredModules -ListAvailable
19+
Write-Host "Installed modules:" -ForegroundColor Yellow
20+
$InstalledModules | ft Name, Version
21+
if ( ($InstalledModules.count -lt $RequiredModules.Count) -or ($Null -eq $InstalledModules)) {
22+
throw "Required modules are missing."
23+
} else {
24+
Write-Host "All required modules found!" -ForegroundColor Green
25+
}
26+
27+
#---------------------------------#
28+
# build configuration #
29+
#---------------------------------#
30+
build_script:
31+
-ps:|
32+
Write-Host "Build project" -ForegroundColor Yellow
33+
Write-Host "Build version : $env:APPVEYOR_BUILD_VERSION"
34+
Write-Host "Branch : $env:APPVEYOR_REPO_BRANCH"
35+
Write-Host "Repo : $env:APPVEYOR_REPO_NAME"
36+
Write-Host "Running Build.ps1..." -ForegroundColor Yellow
37+
. .\Build.ps1
38+
# - cd ..\Build\ExchangeTrackingGUI
39+
# - mkdir "%ProgramFiles%\WindowsPowerShell\Modules\ExchangeTrackingGUI"
40+
# - copy ExchangeTrackingGUI.psm1 "%ProgramFiles%\WindowsPowerShell\Modules\ExchangeTrackingGUI"
41+
# - copy ExchangeTrackingGUI.psd1 "%ProgramFiles%\WindowsPowerShell\Modules\ExchangeTrackingGUI"
42+
-ps:|
43+
Import-Module -Name .\ExchangeTrackingGUI.psm1
44+
Write-Host "...completed!" -ForegroundColor Green
45+
46+
#---------------------------------#
47+
# test configuration #
48+
#---------------------------------#
49+
test_script:
50+
-ps:|
51+
Write-Host "Running Test script" -ForegroundColor Yellow
52+
$testResultsFile = ".\TestsResults.xml"
53+
$res = Invoke-Pester -ExcludeTag 'Markdown','Examples' -OutputFormat NUnitXml -OutputFile $testResultsFile -PassThru
54+
$URI = "https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)"
55+
$WC = New-Object 'System.Net.WebClient'
56+
Write-Host "About to upload file: $(Resolve-Path $testResultsFile)"
57+
try {
58+
$WC.UploadFile($URI, (Resolve-Path $testResultsFile))
59+
} catch {
60+
Write-Host "Uploading failed!" -ForegroundColor Red
61+
}
62+
63+
if (($res.FailedCount -gt 0) -or ($res.PassedCount -eq 0) -or ($null -eq $res)) {
64+
throw "$($res.FailedCount) tests failed."
65+
} else {
66+
Write-Host "All tests passed!" -ForegroundColor Green
67+
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp