Skip to content

Commit

Permalink
Merge pull request #117 from AArnott/github-actions-update
Browse files Browse the repository at this point in the history
GitHub workflows update
  • Loading branch information
AArnott authored Sep 13, 2021
2 parents eba9acb + 4854ca1 commit 0e9d868
Show file tree
Hide file tree
Showing 4 changed files with 30 additions and 30 deletions.
12 changes: 5 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
fail-fast: false
matrix:
os:
- ubuntu-18.04
- ubuntu-20.04
- macos-latest
- windows-latest

Expand Down Expand Up @@ -61,9 +61,8 @@ jobs:
- name: Upload variables
uses: actions/upload-artifact@v1
with:
name: variables
name: variables-${{ runner.os }}
path: obj/_artifacts/variables
if: runner.os == 'Windows'
continue-on-error: true
- name: Upload build_logs
if: always()
Expand All @@ -89,16 +88,15 @@ jobs:
- name: Upload symbols
uses: actions/upload-artifact@v1
with:
name: symbols
name: symbols-${{ runner.os }}
path: obj/_artifacts/symbols
if: runner.os == 'Windows'
continue-on-error: true
- name: Upload deployables
uses: actions/upload-artifact@v1
with:
name: deployables
name: deployables-${{ runner.os }}
path: obj/_artifacts/deployables
if: always() && runner.os == 'Windows'
if: always()
- name: Publish code coverage results to codecov.io
run: bash <(curl -s https://codecov.io/bash)
shell: bash
Expand Down
12 changes: 9 additions & 3 deletions azure-pipelines/Convert-PDB.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,19 @@
[string]$OutputPath
)

if ($IsMacOS -or $IsLinux) {
Write-Error "This script only works on Windows"
return
}

$version = '1.1.0-beta2-21101-01'
$baseDir = "$PSScriptRoot\..\obj\tools"
$pdb2pdbpath = "$baseDir\Microsoft.DiaSymReader.Pdb2Pdb.$version\tools\Pdb2Pdb.exe"
$baseDir = "$PSScriptRoot/../obj/tools"
$pdb2pdbpath = "$baseDir/Microsoft.DiaSymReader.Pdb2Pdb.$version/tools/Pdb2Pdb.exe"
if (-not (Test-Path $pdb2pdbpath)) {
if (-not (Test-Path $baseDir)) { New-Item -Type Directory -Path $baseDir | Out-Null }
$baseDir = (Resolve-Path $baseDir).Path # Normalize it
& (& $PSScriptRoot\Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null
Write-Verbose "& (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null"
& (& $PSScriptRoot/Get-NuGetTool.ps1) install Microsoft.DiaSymReader.Pdb2Pdb -version $version -PackageSaveMode nuspec -OutputDirectory $baseDir -Source https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json | Out-Null
}

$args = $DllPath,'/out',$OutputPath,'/nowarn','0021'
Expand Down
26 changes: 14 additions & 12 deletions azure-pipelines/Get-SymbolFiles.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ $WindowsPdbSubDirName = "symstore"

$ActivityName = "Collecting symbols from $Path"
Write-Progress -Activity $ActivityName -CurrentOperation "Discovery PDB files"
$PDBs = Get-ChildItem -rec "$Path\*.pdb" |? { $_.FullName -notmatch "\W$WindowsPdbSubDirName\W" }
$PDBs = Get-ChildItem -rec "$Path/*.pdb" |? { $_.FullName -notmatch "\W$WindowsPdbSubDirName\W" }

# Filter PDBs to product OR test related.
$testregex = "unittest|tests"
Expand All @@ -44,8 +44,8 @@ $PDBs |% {
}
} |% {
# Collect the DLLs/EXEs as well.
$dllPath = "$($_.Directory)\$($_.BaseName).dll"
$exePath = "$($_.Directory)\$($_.BaseName).exe"
$dllPath = "$($_.Directory)/$($_.BaseName).dll"
$exePath = "$($_.Directory)/$($_.BaseName).exe"
if (Test-Path $dllPath) {
$BinaryImagePath = $dllPath
} elseif (Test-Path $exePath) {
Expand All @@ -54,14 +54,16 @@ $PDBs |% {

Write-Output $BinaryImagePath

# Convert the PDB to legacy Windows PDBs
Write-Host "Converting PDB for $_" -ForegroundColor DarkGray
$WindowsPdbDir = "$($_.Directory.FullName)\$WindowsPdbSubDirName"
if (!(Test-Path $WindowsPdbDir)) { mkdir $WindowsPdbDir | Out-Null }
& "$PSScriptRoot\Convert-PDB.ps1" -DllPath $BinaryImagePath -PdbPath $_ -OutputPath "$WindowsPdbDir\$($_.BaseName).pdb"
if ($LASTEXITCODE -ne 0) {
Write-Warning "PDB conversion of `"$_`" failed."
}
if (-not ($IsMacOS -or $IsLinux)) {
# Convert the PDB to legacy Windows PDBs
Write-Host "Converting PDB for $_" -ForegroundColor DarkGray
$WindowsPdbDir = "$($_.Directory.FullName)\$WindowsPdbSubDirName"
if (!(Test-Path $WindowsPdbDir)) { mkdir $WindowsPdbDir | Out-Null }
& "$PSScriptRoot\Convert-PDB.ps1" -DllPath $BinaryImagePath -PdbPath $_ -OutputPath "$WindowsPdbDir\$($_.BaseName).pdb"
if ($LASTEXITCODE -ne 0) {
Write-Warning "PDB conversion of `"$_`" failed."
}

Write-Output "$WindowsPdbDir\$($_.BaseName).pdb"
Write-Output "$WindowsPdbDir\$($_.BaseName).pdb"
}
}
10 changes: 2 additions & 8 deletions azure-pipelines/artifacts/symbols.ps1
Original file line number Diff line number Diff line change
@@ -1,11 +1,5 @@
# This doesn't work off Windows, nor do we need to convert symbols on multiple OS agents
if ($IsMacOS -or $IsLinux) {
return;
}

$BinPath = [System.IO.Path]::GetFullPath("$PSScriptRoot\..\..\bin")
if (!(Test-Path $BinPath)) { return }
$symbolfiles = & "$PSScriptRoot\..\Get-SymbolFiles.ps1" -Path $BinPath | Get-Unique
$BinPath = [System.IO.Path]::GetFullPath("$PSScriptRoot/../../bin")
$symbolfiles = & "$PSScriptRoot/../Get-SymbolFiles.ps1" -Path $BinPath | Get-Unique

@{
"$BinPath" = $SymbolFiles;
Expand Down

0 comments on commit 0e9d868

Please sign in to comment.