119 lines
3.4 KiB
YAML
119 lines
3.4 KiB
YAML
# Starter pipeline
|
|
# Start with a minimal pipeline that you can customize to build and deploy your code.
|
|
# Add steps that build, run tests, deploy, and more:
|
|
# https://aka.ms/yaml
|
|
|
|
name: $(TeamProject)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.rr)
|
|
|
|
# Trigger CI on commit to master branch
|
|
trigger:
|
|
branches:
|
|
include:
|
|
- master
|
|
- zvma-updates
|
|
|
|
# Trigger CI on pull requests to master and develop branches
|
|
pr:
|
|
- master
|
|
- zvma-updates
|
|
|
|
jobs:
|
|
# Windows PowerShell 5.1 Build Job
|
|
- job: Build_PS_Windows
|
|
timeoutInMinutes: 10
|
|
cancelTimeoutInMinutes: 2
|
|
pool:
|
|
vmImage: windows-latest
|
|
steps:
|
|
# Run build.ps1 script in PowerShell Core
|
|
- powershell: |
|
|
.\build.ps1 -Verbose
|
|
displayName: "Build and Test"
|
|
# Upload test results to Azure Pipeline
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testRunner: "NUnit"
|
|
testResultsFiles: "**/BuiltTestResults.xml"
|
|
testRunTitle: "PS_Win2016_Built"
|
|
displayName: "Publish Test Results"
|
|
condition: always()
|
|
|
|
# Windows PowerShell Core Build Job
|
|
- job: Build_PSCore_Windows
|
|
timeoutInMinutes: 10
|
|
cancelTimeoutInMinutes: 2
|
|
pool:
|
|
vmImage: windows-latest
|
|
steps:
|
|
# Run build.ps1 script in PowerShell Core
|
|
- pwsh: |
|
|
.\build.ps1 -Verbose
|
|
displayName: "Build and Test"
|
|
# Upload test results to Azure Pipeline
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testRunner: "NUnit"
|
|
testResultsFiles: "**/BuiltTestResults.xml"
|
|
testRunTitle: "PSCore_Win2016_Built"
|
|
displayName: "Publish Test Results"
|
|
condition: always()
|
|
|
|
# Linux Build Job
|
|
- job: Build_PSCore_Ubuntu
|
|
timeoutInMinutes: 10
|
|
cancelTimeoutInMinutes: 2
|
|
pool:
|
|
vmImage: ubuntu-latest
|
|
steps:
|
|
# Run build.ps1 script in PowerShell Core
|
|
- pwsh: |
|
|
.\build.ps1 -verbose
|
|
displayName: "Build and Test"
|
|
# Upload test results to Azure Pipeline
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testRunner: "NUnit"
|
|
testResultsFiles: "**/BuiltTestResults.xml"
|
|
testRunTitle: "PSCore_Ubuntu_Built"
|
|
displayName: "Publish Test Results"
|
|
condition: always()
|
|
- task: PublishPipelineArtifact@1
|
|
displayName: "Publish Data"
|
|
inputs:
|
|
artifactName: "ReleaseData"
|
|
targetPath: ./publish
|
|
condition: always()
|
|
|
|
# MacOS Build Job
|
|
- job: Build_PSCore_MacOS
|
|
timeoutInMinutes: 10
|
|
cancelTimeoutInMinutes: 2
|
|
pool:
|
|
vmImage: macOS-latest
|
|
steps:
|
|
# Run build.ps1 script in PowerShell Core
|
|
- pwsh: |
|
|
.\build.ps1 -verbose
|
|
displayName: "Build and Test"
|
|
# Upload test results to Azure Pipeline
|
|
- task: PublishTestResults@2
|
|
inputs:
|
|
testRunner: "NUnit"
|
|
testResultsFiles: "**/BuiltTestResults.xml"
|
|
testRunTitle: "PSCore_MacOS1013_Built"
|
|
displayName: "Publish Test Results"
|
|
condition: always()
|
|
|
|
# Publish Module to Gallery
|
|
- job: Publish
|
|
dependsOn: Build
|
|
condition: and(succeeded(), eq(variables['Build.SourceBranch'], 'refs/heads/zvma-updates'))
|
|
pool:
|
|
vmImage: 'windows-latest'
|
|
steps:
|
|
- powershell: |
|
|
Install-Module -Name PowerShellGet -Force -Scope CurrentUser
|
|
$apiKey = "$(PowerShellGalleryApiKey)"
|
|
Publish-Module -Name 'ZertoApiWrapper' -NuGetApiKey $apiKey
|
|
displayName: 'Publish to PowerShell Gallery'
|