|
1 | 1 | parameters:
|
2 |
| - pwsh: true |
| 2 | +- name: pwsh |
| 3 | + type: boolean |
| 4 | + default: true |
3 | 5 |
|
4 | 6 | steps:
|
5 |
| - - powershell: | |
6 |
| - Write-Host "Installing PowerShell Daily..." |
| 7 | +- pwsh: $PSVersionTable |
| 8 | + displayName: PowerShell version |
7 | 9 |
|
8 |
| - # Use `AGENT_TEMPDIRECTORY` to make sure the downloaded PowerShell is cleaned up. |
9 |
| - $powerShellPath = Join-Path -Path $env:AGENT_TEMPDIRECTORY -ChildPath 'powershell' |
10 |
| - Invoke-WebRequest -Uri https://aka.ms/install-powershell.ps1 -OutFile ./install-powershell.ps1 |
| 10 | +- task: PowerShell@2 |
| 11 | + displayName: Build and test |
| 12 | + inputs: |
| 13 | + filePath: tools/azurePipelinesBuild.ps1 |
| 14 | + pwsh: ${{ parameters.pwsh }} |
11 | 15 |
|
12 |
| - ./install-powershell.ps1 -Destination $powerShellPath -Daily |
| 16 | +# NOTE: We zip the artifacts because they're ~20 MB compressed, but ~300 MB raw, |
| 17 | +# and we have limited pipeline artifact storage space. |
| 18 | +- task: ArchiveFiles@2 |
| 19 | + displayName: Zip pipeline artifacts |
| 20 | + inputs: |
| 21 | + rootFolderOrFile: module |
| 22 | + includeRootFolder: false |
| 23 | + archiveType: zip |
| 24 | + archiveFile: PowerShellEditorServices-Build.zip |
| 25 | + verbose: true |
13 | 26 |
|
14 |
| - # Using `prependpath` to update the PATH just for this build. |
15 |
| - Write-Host "##vso[task.prependpath]$powerShellPath" |
16 |
| - displayName: Install PowerShell Daily |
17 |
| - continueOnError: true |
| 27 | +- publish: PowerShellEditorServices-Build.zip |
| 28 | + artifact: PowerShellEditorServices-Build-$(System.JobId) |
| 29 | + displayName: Publish unsigned pipeline artifacts |
18 | 30 |
|
19 |
| - - pwsh: '$PSVersionTable' |
20 |
| - displayName: Display PowerShell version information |
21 |
| - |
22 |
| - - pwsh: Write-Host "##vso[build.updatebuildnumber]$env:BUILD_SOURCEBRANCHNAME-$env:BUILD_SOURCEVERSION-$((get-date).ToString("yyyyMMddhhmmss"))" |
23 |
| - displayName: Set Build Name for Non-PR |
24 |
| - condition: ne(variables['Build.Reason'], 'PullRequest') |
25 |
| - - task: PowerShell@2 |
26 |
| - inputs: |
27 |
| - filePath: scripts/azurePipelinesBuild.ps1 |
28 |
| - pwsh: ${{ parameters.pwsh }} |
29 |
| - - task: PublishTestResults@2 |
30 |
| - inputs: |
31 |
| - testRunner: VSTest |
32 |
| - testResultsFiles: '**/*.trx' |
33 |
| - condition: succeededOrFailed() |
34 |
| - - task: PublishTestResults@2 |
35 |
| - inputs: |
36 |
| - testRunner: NUnit |
37 |
| - testResultsFiles: '**/TestResults.xml' |
38 |
| - condition: succeededOrFailed() |
39 |
| - - task: PublishBuildArtifacts@1 |
40 |
| - inputs: |
41 |
| - ArtifactName: PowerShellEditorServices-CI |
42 |
| - PathtoPublish: '$(Build.ArtifactStagingDirectory)' |
43 |
| - condition: succeededOrFailed() |
| 31 | +- task: PublishTestResults@2 |
| 32 | + displayName: Publish test results |
| 33 | + inputs: |
| 34 | + testRunner: VSTest |
| 35 | + testResultsFiles: '**/*.trx' |
| 36 | + condition: succeededOrFailed() |
0 commit comments