File size: 2,586 Bytes
8c763fb
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
90
91
92
93
94
95
96
97
98
name: PR-$(System.PullRequest.PullRequestNumber)-$(Date:yyyyMMdd)$(Rev:.rr)
trigger:
  # Batch merge builds together while a merge build is running
  batch: true
  branches:
    include:
    - master
    - release*
    - feature*
  paths:
    include:
    - '/src/System.Management.Automation/engine/*'
    - '/test/SSHRemoting/*'
pr:
  branches:
    include:
    - master
    - release*
    - feature*
  paths:
    include:
    - '/src/System.Management.Automation/engine/*'
    - '/test/SSHRemoting/*'

variables:
  - name: DOTNET_CLI_TELEMETRY_OPTOUT
    value: 1
  - name: POWERSHELL_TELEMETRY_OPTOUT
    value: 1
  - name: DOTNET_NOLOGO
    value: 1
  - name:  __SuppressAnsiEscapeSequences
    value: 1
  - name: NugetSecurityAnalysisWarningLevel
    value: none
# Prevents auto-injection of nuget-security-analysis@0
  - name: skipNugetSecurityAnalysis
    value: true


resources:
- repo: self
  clean: true
jobs:
- job: SSHRemotingTests
  pool:
    vmImage: ubuntu-20.04
  container: mcr.microsoft.com/powershell/test-deps:ubuntu-18.04
  displayName: SSH Remoting Tests

  steps:
  - pwsh: |
      Get-ChildItem -Path env: | Out-String -width 9999 -Stream | write-Verbose -Verbose
    displayName: Capture Environment
    condition: succeededOrFailed()

  - pwsh:  Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))"
    displayName: Set Build Name for Non-PR
    condition: ne(variables['Build.Reason'], 'PullRequest')

  - template: /tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml

  - pwsh: |
      sudo apt-get update
      sudo apt-get install -y git
    displayName: Install Github
    condition: succeeded()

  - pwsh: |
      Import-Module .\tools\ci.psm1
      Invoke-CIInstall -SkipUser
    displayName: Bootstrap
    condition: succeededOrFailed()

  - pwsh: |
      Import-Module .\tools\ci.psm1
      Invoke-CIBuild
    displayName: Build
    condition: succeeded()

  - pwsh: |
      Import-Module .\tools\ci.psm1
      Restore-PSOptions
      $options = (Get-PSOptions)
      Import-Module .\test\tools\Modules\HelpersRemoting
      Install-SSHRemoting -PowerShellFilePath $options.Output
    displayName: Install SSH Remoting
    condition: succeeded()

  - pwsh: |
      Import-Module .\tools\ci.psm1
      Restore-PSOptions
      $options = (Get-PSOptions)
      Import-Module .\build.psm1
      Start-PSPester -Path test/SSHRemoting -powershell $options.Output -OutputFile "$PWD/sshTestResults.xml"
    displayName: Test
    condition: succeeded()