Skip to content

Commit

Permalink
Merge pull request #1220 from microsoft/main
Browse files Browse the repository at this point in the history
Merge 'main' into 'release-cpptools'
  • Loading branch information
WardenGnaw authored Sep 10, 2021
2 parents fbe1a96 + a0a3729 commit ef5597b
Show file tree
Hide file tree
Showing 71 changed files with 4,418 additions and 1,079 deletions.
36 changes: 12 additions & 24 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,11 +29,9 @@ jobs:
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]

- name: Restore the application
run: NuGet.exe restore ${{ github.workspace }}\src\MIDebugEngine.sln

- name: Build the application
run: msbuild ${{ github.workspace }}\src\MIDebugEngine.sln /p:Configuration=$env:Configuration
- name: Build MIDebugEngine
run: |
${{ github.workspace }}/eng/Scripts/CI-Build.cmd -c $env:Configuration -t vs
env:
Configuration: ${{ matrix.configuration }}

Expand Down Expand Up @@ -63,17 +61,12 @@ jobs:
- name: Setup NuGet.exe for use with actions
uses: NuGet/[email protected]

- name: Restore the application
run: NuGet.exe restore ${{ github.workspace }}\src\MIDebugEngine.sln

- name: Build the application
run: msbuild ${{ github.workspace }}\src\MIDebugEngine.sln /p:Configuration=Debug
- name: Build MIDebugEngine
run: |
${{ github.workspace }}/eng/Scripts/CI-Build.cmd -t vscode
- name: Build OpenDebugAD7
- name: Copy Test Configuration
run: |
dotnet publish ${{ github.workspace }}\src\OpenDebugAD7\OpenDebugAD7.csproj -c Debug -r win-x64 --self-contained -o ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\extension\debugAdapters
copy ${{ github.workspace }}\bin\Debug\Microsoft.MIDebugEngine.dll ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\extension\debugAdapters/.
copy ${{ github.workspace }}\bin\Debug\Microsoft.MICore.dll ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\extension\debugAdapters\.
copy ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\TestConfigurations\config_msys_gdb.xml ${{ github.workspace }}\bin\DebugAdapterProtocolTests\Debug\CppTests\config.xml
- name: Setup MSYS2
Expand Down Expand Up @@ -120,12 +113,12 @@ jobs:
# echo 1 | sudo tee /proc/sys/kernel/core_uses_pid
# ulimit -S -c unlimited
# sudo sysctl -w kernel.core_pattern=${{ github.workspace }}/core.%e
- run: |
${{ github.workspace }}/PublishOpenDebugAD7.sh -c Debug -o ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters
cp ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/TestConfigurations/config_gdb.xml ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml
${{ github.workspace }}/eng/Scripts/CI-Build.sh
- run: |
dotnet test ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/CppTests.dll --logger "trx;LogFileName=${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx"
${{ github.workspace }}/eng/Scripts/CI-Test.sh
- name: 'Upload Test Results'
uses: actions/upload-artifact@v2
Expand All @@ -151,15 +144,10 @@ jobs:
run: dotnet build ${{ github.workspace }}/src/MIDebugEngine-Unix.sln

- run: |
${{ github.workspace }}/PublishOpenDebugAD7.sh -c Debug -o ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters
cp ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/TestConfigurations/config_lldb.xml ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml
- name: Download LLDB-MI
run: |
${{ github.workspace }}/tools/DownloadLldbMI.sh ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters
${{ github.workspace }}/eng/Scripts/CI-Build.sh
- run: |
dotnet test ${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/CppTests.dll --logger "trx;LogFileName=${{ github.workspace }}/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx"
${{ github.workspace }}/eng/Scripts/CI-Test.sh
- name: 'Upload Test Results'
uses: actions/upload-artifact@v2
Expand Down
15 changes: 15 additions & 0 deletions eng/Scripts/CI-Build.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
@echo off
setlocal

if "%~1"=="/?" goto Help
if "%~1"=="-?" goto Help
if "%~1"=="-h" goto Help

@SET Args= %*
@SET Args=%Args: /= -%
powershell -NoProfile -ExecutionPolicy bypass -File %~dp0CI-Build.ps1 %Args%
@exit /B %ERRORLEVEL%
goto :EOF

:Help
call powershell -NoProfile -ExecutionPolicy ByPass -Command "get-help %~dp0CI-Build.ps1 -detailed"
54 changes: 54 additions & 0 deletions eng/Scripts/CI-Build.ps1
Original file line number Diff line number Diff line change
@@ -0,0 +1,54 @@
param(
[ValidateSet("Debug", "Release")]
[Alias("c")]
[string]$Configuration="Debug",

[ValidateSet("win-x86", "win10-arm64")]
[Alias("r")]
[string]$RID="win-x86",

[ValidateSet("vs", "vscode")]
[Alias("t")]
[string]$TargetPlatform="vs"
)

$ErrorActionPreference="Stop"

$RootPath = Resolve-Path -Path "$PSScriptRoot\..\.."

$msbuildPath = (Get-Command msbuild.exe -ErrorAction Ignore).Path

if (!$msbuildPath) {
throw "Please run the script from a developer command prompt or have msbuild.exe in your PATH"
}

msbuild /t:Restore $RootPath\src\MIDebugEngine.sln /p:Configuration=$Configuration
if ($lastexitcode -ne 0)
{
throw "Failed to restore packages for MIDebugEngine.sln"
}
msbuild $RootPath\src\MIDebugEngine.sln /p:Configuration=$Configuration
if ($lastexitcode -ne 0)
{
throw "Failed to build MIDebugEngine.sln"
}


if ($TargetPlatform -eq "vscode")
{
$dotnetPath = (Get-Command dotnet.exe -ErrorAction Ignore).Path;

if (!$dotnetPath) {
throw "Missing .NET SDK. Please install the SDK at https://dotnet.microsoft.com/download"
}

dotnet publish $RootPath\src\OpenDebugAD7\OpenDebugAD7.csproj -c $Configuration -r $RID --self-contained -o $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters
if ($lastexitcode -ne 0)
{
throw "Failed to publish OpenDebugAD7"
}

Copy-Item $RootPath\bin\$Configuration\Microsoft.MIDebugEngine.dll $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters/.
Copy-Item $RootPath\bin\$Configuration\Microsoft.MICore.dll $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters\.
Copy-Item $RootPath\bin\$Configuration\vscode\WindowsDebugLauncher.exe $RootPath\bin\DebugAdapterProtocolTests\$Configuration\extension\debugAdapters\.
}
21 changes: 21 additions & 0 deletions eng/Scripts/CI-Build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
#!/bin/bash

ScriptDir=$(dirname "$0")
RootDir=$ScriptDir/../..

if [ "$(which dotnet)" == "" ]; then
echo "ERROR: Missing .NET SDK. Please install the SDK at https://dotnet.microsoft.com/download"
exit 1
fi

if ! dotnet build "$RootDir"/src/MIDebugEngine-Unix.sln; then
echo "ERROR: Failed to build MIDebugEngine-Unix.sln"
exit 1
fi

if ! "$RootDir"/PublishOpenDebugAD7.sh -c Debug -o "$RootDir"/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters; then
echo "ERROR: Failed to build MIDebugEngine-Unix.sln"
exit 1
fi

exit 0
22 changes: 22 additions & 0 deletions eng/Scripts/CI-Test.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
#!/bin/bash

ScriptDir=$(dirname "$0")
RootDir=$ScriptDir/../..

if [ "$(which dotnet)" == "" ]; then
echo "ERROR: Missing .NET SDK. Please install the SDK at https://dotnet.microsoft.com/download"
fi

if [ ! -f "$RootDir/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml" ]; then
if [ "$(uname)" = "Darwin" ]; then
if ! "$RootDir"/tools/DownloadLldbMI.sh "$RootDir"/bin/DebugAdapterProtocolTests/Debug/extension/debugAdapters; then
echo "ERROR: Failed to download lldb-mi"
exit 1
fi
cp "$RootDir"/bin/DebugAdapterProtocolTests/Debug/CppTests/TestConfigurations/config_lldb.xml "$RootDir"/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml
else
cp "$RootDir"/bin/DebugAdapterProtocolTests/Debug/CppTests/TestConfigurations/config_gdb.xml "$RootDir"/bin/DebugAdapterProtocolTests/Debug/CppTests/config.xml
fi
fi

dotnet test "$RootDir"/bin/DebugAdapterProtocolTests/Debug/CppTests/CppTests.dll --logger "trx;LogFileName=$RootDir/bin/DebugAdapterProtocolTests/Debug/CppTests/results.trx"
4 changes: 2 additions & 2 deletions eng/pipelines/MIDebugEngine-CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,15 +20,15 @@ stages:
- name: TeamName
value: MDDDebugger
jobs:
- template: ./jobs/VSEngSS-MicroBuild2019.job.yml
- template: ./jobs/VSEngSS-MicroBuild2019-1ES.job.yml
parameters:
DisplayName: 'Lab.Debug'
JobTemplate:
- template: ../templates/Build.template.yml
parameters:
Configuration: 'Lab.Debug'

- template: ./jobs/VSEngSS-MicroBuild2019.job.yml
- template: ./jobs/VSEngSS-MicroBuild2019-1ES.job.yml
parameters:
DisplayName: 'Lab.Release'
JobTemplate:
Expand Down
2 changes: 1 addition & 1 deletion eng/pipelines/VS-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: $(Date:yyyMMdd).$(Rev:r)
variables:
- group: TSDTUSR
jobs:
- template: ./jobs/VSEngSS-MicroBuild2019.job.yml
- template: ./jobs/VSEngSS-MicroBuild2019-1ES.job.yml
parameters:
DisplayName: 'VS_Release'
JobTemplate:
Expand Down
4 changes: 2 additions & 2 deletions eng/pipelines/VSCode-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ stages:
- stage: Windows
dependsOn: []
jobs:
- template: ./jobs/VSEngSS-MicroBuild2019.job.yml
- template: ./jobs/VSEngSS-MicroBuild2019-1ES.job.yml
parameters:
DisplayName: 'VSCode_Release'
JobTemplate:
Expand All @@ -24,7 +24,7 @@ stages:
- stage: OSX_ESRPSign
dependsOn: [OSX_CodeSign]
jobs:
- template: ./jobs/VSEngSS-MicroBuild2019.job.yml
- template: ./jobs/VSEngSS-MicroBuild2019-1ES.job.yml
parameters:
DisplayName: 'OSX Sign/Harden'
JobTemplate:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ jobs:
- job:
displayName: ${{ parameters.DisplayName }}
pool:
name: VSEngSS-MicroBuild2019
name: VSEngSS-MicroBuild2019-1ES
demands:
- msbuild
- visualstudio
Expand Down
6 changes: 6 additions & 0 deletions eng/pipelines/templates/Build.template.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,5 +17,11 @@ steps:
parameters:
Configuration: ${{ parameters.Configuration }}

# Used for localization
- template: ../steps/CollectAndPublishBinaries.yml
parameters:
TargetFolder: '$(Build.StagingDirectory)\drop'
ArtifactName: '${{ parameters.Configuration }}'

- template: ../tasks/MicroBuildCleanup.yml
...
89 changes: 85 additions & 4 deletions loc/lcl/CHS/Microsoft.SSHDebugPS.dll.lcl

Large diffs are not rendered by default.

Loading

0 comments on commit ef5597b

Please sign in to comment.