mirror of
https://github.com/PowerShell/PowerShell.git
synced 2024-11-27 03:46:23 +08:00
058a19028d
Refactor macOS CI so that tests run in parallel - Also: - Fix bootstrap issue where curl was failing for a month (so obviously not needed) - Change Windows test stages to use PowerShell Core (where we can) to avoid compat issues ## PR Context This allows running all tests in about the same about of clock time.
103 lines
2.9 KiB
YAML
103 lines
2.9 KiB
YAML
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*
|
|
paths:
|
|
include:
|
|
- '*'
|
|
exclude:
|
|
- /tools/releaseBuild/**/*
|
|
- /.vsts-ci/misc-analysis.yml
|
|
pr:
|
|
branches:
|
|
include:
|
|
- master
|
|
- release*
|
|
paths:
|
|
include:
|
|
- '*'
|
|
exclude:
|
|
- /tools/releaseBuild/**/*
|
|
- /.vsts-ci/misc-analysis.yml
|
|
variables:
|
|
DOTNET_CLI_TELEMETRY_OPTOUT: 1
|
|
POWERSHELL_TELEMETRY_OPTOUT: 1
|
|
# Avoid expensive initialization of dotnet cli, see: http://donovanbrown.com/post/Stop-wasting-time-during-NET-Core-builds
|
|
DOTNET_SKIP_FIRST_TIME_EXPERIENCE: 1
|
|
|
|
resources:
|
|
- repo: self
|
|
clean: true
|
|
jobs:
|
|
- job: Linux_CI
|
|
|
|
pool:
|
|
name: Hosted Ubuntu 1604
|
|
|
|
timeoutInMinutes: 120
|
|
|
|
steps:
|
|
- powershell: |
|
|
Get-Process
|
|
displayName: Capture Processes
|
|
condition: succeededOrFailed()
|
|
|
|
- powershell: |
|
|
Get-ChildItem -Path env:
|
|
displayName: Capture environment
|
|
condition: succeededOrFailed()
|
|
|
|
- powershell: |
|
|
# sometimes the file is locked and we must wait or things will fail
|
|
$filePath = '/var/lib/dpkg/lock'
|
|
$lockList = sudo lsof '/var/lib/dpkg/lock'
|
|
while($lockList)
|
|
{
|
|
Write-Verbose "waiting..." -verbose
|
|
Write-Verbose ($lockList -join "`n") -verbose
|
|
Start-Sleep -Second 30
|
|
$lockList = sudo lsof $filePath
|
|
}
|
|
exit 0
|
|
displayName: Wait for /var/lib/dpkg/lock
|
|
condition: succeededOrFailed()
|
|
|
|
- powershell: 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')
|
|
|
|
# Several scripts require TMPDIR to exist
|
|
# Set it to AGENT_TEMPDIRECTORY so that we know it exists
|
|
- powershell: |
|
|
Write-Host "##vso[task.setvariable variable=TEMP]$env:AGENT_TEMPDIRECTORY"
|
|
displayName: Set TEMP to AGENT_TEMPDIRECTORY
|
|
condition: succeededOrFailed()
|
|
|
|
- template: ../tools/releaseBuild/azureDevOps/templates/insert-nuget-config-azfeed.yml
|
|
|
|
- powershell: |
|
|
Import-Module ./tools/ci.psm1
|
|
Invoke-BootstrapStage
|
|
displayName: Bootstrap
|
|
condition: succeeded()
|
|
|
|
- powershell: |
|
|
Import-Module ./tools/ci.psm1
|
|
$env:NugetKey = '$(NUGET_KEY)'
|
|
Invoke-LinuxTests
|
|
displayName: Build and Test
|
|
condition: succeeded()
|
|
|
|
# Uploads any packages as an artifact
|
|
- powershell: |
|
|
Get-ChildItem -Path ${env:BUILD_ARTIFACTSTAGINGDIRECTORY} -Include *.nupkg, *.rpm, *.deb, *.tar.gz, TestPackage.zip -Recurse | Select-Object -ExpandProperty FullName | ForEach-Object {
|
|
Write-Host "##vso[artifact.upload containerfolder=artifacts;artifactname=artifacts]$_"
|
|
}
|
|
displayName: Publish Artifacts
|
|
condition: succeededOrFailed()
|
|
continueOnError: true
|