Skip to content

Commit

Permalink
Add PR build validation (#68)
Browse files Browse the repository at this point in the history
  • Loading branch information
gregg-miskelly committed Nov 10, 2021
1 parent defe4a8 commit 1e5dec7
Show file tree
Hide file tree
Showing 5 changed files with 92 additions and 175 deletions.
28 changes: 28 additions & 0 deletions .github/workflows/pull-request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: Pull Request

on:
pull_request:
branches: [ main ]

jobs:
windows_build:
strategy:
matrix:
configuration: [Debug, Release]

runs-on: windows-2019

steps:
- name: Checkout
uses: actions/checkout@v2
with:
fetch-depth: 0

- name: Setup NuGet.exe for use with actions
uses: NuGet/setup-nuget@v1.0.5

- name: Build.cmd
run: ${{ github.workspace }}\build.cmd /p:Configuration=$env:Configuration
env:
Configuration: ${{ matrix.configuration }}

124 changes: 0 additions & 124 deletions BuildAndTest.proj

This file was deleted.

6 changes: 0 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,6 @@
## ConcordExtensibilitySamples
Visual Studio Debug Engine Extensibility Samples

Build | Status
------------ | -------------
Release | [![Build Status](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_release/badge/icon)](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_release/)
Debug | [![Build Status](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_debug/badge/icon)](https://ci.dot.net/job/Microsoft_ConcordExtensibilitySamples/job/master/job/windows_debug/)


### What are "Concord Extensibility Samples"?
[Concord](https://github.com/Microsoft/ConcordExtensibilitySamples/wiki/Overview) is the code name for Visual Studio's new debug engine that first shipped in Visual Studio 2012. Concord was designed to be extensible and this repo contains samples of these extensions.

Expand Down
71 changes: 64 additions & 7 deletions build.cmd
Original file line number Diff line number Diff line change
@@ -1,34 +1,91 @@
@echo off
setlocal

if "%~1"=="/?" goto :Help
if "%~1"=="-?" goto :Help
if "%~1"=="-h" goto :Help
set AdditionalBuildArgs=%*

if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt

set x86ProgramFiles=%ProgramFiles(x86)%
if "%x86ProgramFiles%"=="" set x86ProgramFiles=%ProgramFiles%
set VSWherePath=%x86ProgramFiles%\Microsoft Visual Studio\Installer\vswhere.exe
if NOT exist "%VSWherePath%" echo ERROR: Could not find vswhere.exe (%VSWherePath%). Ensure that Visual Studio 2017 version 15.5 or newer is installed. & exit /b -1

for /f "usebackq tokens=1 delims=" %%a in (`"%VSWherePath%" -version [15.0, -prerelease -property installationPath`) do call :ProcessIDE "%%a"
for /f "usebackq tokens=1 delims=" %%a in (`"%VSWherePath%" -version [16.0, -prerelease -requires Microsoft.VisualStudio.Workload.NativeDesktop;Microsoft.VisualStudio.Workload.VisualStudioExtension;Microsoft.VisualStudio.Workload.ManagedDesktop -property installationPath`) do call :ProcessIDE "%%a"
if NOT "%VSINSTALLDIR%"=="" goto InDevPrompt

echo ERROR: Unable to find a Visual Studio install.
exit /b -1

:InDevPrompt
set _buildproj=%~dp0BuildAndTest.proj
set _buildlog=%~dp0msbuild.log
set MSBuildCmd=msbuild "%_buildproj%" /nologo /maxcpucount /nodeReuse:false %*
pushd %~dp0
del /s msbuild.log 2>NUL
set BuildError=
call :SetNugetPath nuget.exe
call :RestoreFromSLN Iris\Iris.sln
call :RestoreFromSLN HelloWorld\cs\HelloWorld.sln
call :RestoreFromPackagesConfig CppCustomVisualizer\dll\packages.config CppCustomVisualizer\packages
call :RestoreFromPackagesConfig HelloWorld\Cpp\dll\packages.config HelloWorld\Cpp\packages
call :Build Iris\Iris.sln Iris "Any CPU"
call :Build HelloWorld\cs\HelloWorld.sln CsHelloWorld "Any CPU"
call :Build HelloWorld\cpp\HelloWorld.sln CppHelloWorld Win32
call :Build CppCustomVisualizer\CppCustomVisualizer.sln CppCustomVisualizer x86

if NOT "%BuildError%"=="" exit /b -1
echo build.cmd completed successfully.
exit /b 0

:RestoreFromPackagesConfig
if NOT "%BuildError%"=="" goto :EOF
set NugetCmd="%NUGET_EXE%" restore %1 -PackagesDirectory %2
echo %NugetCmd%
call %NugetCmd%
if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Restoring %1 failed.& set BuildError=1
goto :EOF

:RestoreFromSLN
if NOT "%BuildError%"=="" goto :EOF
set NugetCmd="%NUGET_EXE%" restore %1
echo %NugetCmd%
call %NugetCmd%
if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Restoring %1 failed.& set BuildError=1
goto :EOF

:Build
if NOT "%BuildError%"=="" goto :EOF
REM NOTE: To enable binary logs, add: `/bl:%2.binlog` after `%1`
set MSBuildCmd=msbuild.exe %1 /nologo /maxcpucount /nodeReuse:false /p:Platform=%3 %AdditionalBuildArgs%

echo %MSBuildCmd%
call %MSBuildCmd%
set BUILDERRORLEVEL=%ERRORLEVEL%
if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Building %1 failed.& set BuildError=1
goto :EOF

:SetNugetPath
set NUGET_EXE=%~$PATH:1
if NOT "%NUGET_EXE%"=="" goto :EOF
if exist obj\nuget.exe set NUGET_EXE=%~dp0obj\nuget.exe& goto :EOF

echo Build Exit Code = %BUILDERRORLEVEL%
exit /b %BUILDERRORLEVEL%
if not exist obj mkdir obj
call powershell.exe -NoProfile -Command "[Net.ServicePointManager]::SecurityProtocol = [Net.SecurityProtocolType]::Tls12; Invoke-WebRequest -Uri 'https://dist.nuget.org/win-x86-commandline/latest/nuget.exe' -OutFile obj\nuget.exe"
if NOT "%ERRORLEVEL%"=="0" echo ERROR: build.cmd: Downloading nuget.exe failed.& set BuildError=1& goto :EOF
if NOT exist obj\nuget.exe echo ERROR: build.cmd: nuget.exe is unexpectedly missing.& set BuildError=1& goto :EOF

set NUGET_EXE=%~dp0obj\nuget.exe
goto :EOF

:ProcessIDE
if NOT "%VSINSTALLDIR%"=="" goto :EOF
if NOT exist "%~1\Common7\Tools\VsDevCmd.bat" goto :EOF
echo Using Visual Studio from %1
call "%~1\Common7\Tools\VsDevCmd.bat"
goto :EOF

:Help
echo Build.cmd [Additional msbuild arguments]
echo.
echo This script restores and builds all projects in this repo.
echo.
echo Example usage: build.cmd /p:Configuration=Debug
38 changes: 0 additions & 38 deletions netci.groovy

This file was deleted.

0 comments on commit 1e5dec7

Please sign in to comment.