Skip to content

add appveyor #1

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 11 commits into
base: dev
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 29 additions & 0 deletions appveyor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
version: 0.1.{build}
pull_requests:
do_not_increment_build_number: true
branches:
only:
- dev
- master

image:
- Ubuntu
- Visual Studio 2017

max_jobs: 1

configuration: Debug

install:
- pwsh: Install-Module PSDepend -Force -Scope CurrentUser

build_script:
- pwsh: |
$ErrorActionPreference = "Stop"
./build.ps1 -Clean -Configuration $env:CONFIGURATION

test_script:
- pwsh: ./build.ps1 -NoBuild -Test

artifacts:
- path: package\bin\*\Microsoft.Azure.Functions.PowerShellWorker.*.nupkg
50 changes: 26 additions & 24 deletions build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,10 @@ param(
[switch]
$Test,

[Parameter()]
[switch]
$NoBuild,

[Parameter()]
[string]
$Configuration = "Debug"
Expand Down Expand Up @@ -54,37 +58,35 @@ if ($missingTools.Count -gt 0) {
return
}

# Start at the root of the directory
Push-Location $PSScriptRoot

# Clean step
if($Clean) {
if($Clean.IsPresent) {
Push-Location $PSScriptRoot
git clean -fdx
Pop-Location
}

# Build step
if(!$NoBuild.IsPresent) {
# Install using PSDepend if it's available, otherwise use the backup script
if ((Get-Module -ListAvailable -Name PSDepend).Count -gt 0) {
Invoke-PSDepend -Path "$PSScriptRoot/src" -Force
} else {
& "$PSScriptRoot/tools/InstallDependencies.ps1"
}

# Install using PSDepend if it's available, otherwise use the backup script
if ((Get-Module -ListAvailable -Name PSDepend).Count -gt 0) {
Invoke-PSDepend -Path src -Force
} else {
& "$PSScriptRoot/tools/InstallDependencies.ps1"
dotnet publish -c $Configuration $PSScriptRoot
dotnet pack -c $Configuration "$PSScriptRoot/package"
}

dotnet build -c $Configuration
dotnet publish -c $Configuration

Push-Location package
dotnet pack -c $Configuration
Pop-Location

# Test step
if($Test) {
Push-Location test
dotnet test
Invoke-Pester Modules
Pop-Location
}
if($Test.IsPresent) {
dotnet test "$PSScriptRoot/test"

# Return to the original directory
Pop-Location
if($env:APPVEYOR) {
$res = Invoke-Pester "$PSScriptRoot/test/Modules" -OutputFormat NUnitXml -OutputFile TestsResults.xml -PassThru
(New-Object 'System.Net.WebClient').UploadFile("https://ci.appveyor.com/api/testresults/nunit/$($env:APPVEYOR_JOB_ID)", (Resolve-Path .\TestsResults.xml))
if ($res.FailedCount -gt 0) { throw "$($res.FailedCount) tests failed." }
} else {
Invoke-Pester "$PSScriptRoot/test/Modules"
}
}
44 changes: 0 additions & 44 deletions test/Requests/HandleWorkerInitRequestTests.cs

This file was deleted.