Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Enable public Azure DevOps builds #366

Merged
merged 5 commits into from
Nov 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .codeql.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,6 @@ parameters:
default: true

variables:
- template: eng/common/templates/variables/pool-providers.yml
# CG is handled in the primary CI pipeline
- name: skipComponentGovernanceDetection
value: true
Expand Down Expand Up @@ -59,7 +58,7 @@ jobs:
- script: .\build.cmd EnableSkipStrongNames
displayName: Windows Build - EnableSkipStrongNames

- script: .\build.cmd
- script: .\build.cmd Build /p:BuildPortable=true /p:Desktop=false
displayName: Windows Build

- task: CodeQL3000Finalize@0
Expand Down
92 changes: 92 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
parameters:
# Test only the Release build by default.
- name: ReleaseBuildTarget
displayName: 'Build which target for Release?'
type: string
values: [ Build, Integration, UnitTest ]
default: UnitTest
- name: OtherBuildTarget
displayName: 'Build which target for Debug/CodeAnalysis?'
type: string
values: [ Build, Integration, UnitTest ]
default: Build

variables:
- name: DOTNET_CLI_TELEMETRY_OPTOUT
value: 1
# Run CodeQL3000 tasks in a separate internal pipeline; not needed here.
- name: Codeql.SkipTaskAutoInjection
value: true

trigger: [main]
pr: ['*']

jobs:
- job: build
displayName: Build
pool:
${{ if eq(variables['System.TeamProject'], 'public') }}:
mkArtakMSFT marked this conversation as resolved.
Show resolved Hide resolved
name: NetCore-Public
demands: ImageOverride -equals windows.vs2017.amd64.open
${{ else }}:
name: NetCore1ESPool-Internal
demands: ImageOverride -equals windows.vs2017.amd64
timeoutInMinutes: 30

strategy:
matrix:
Release:
_BuildTarget: ${{ parameters.ReleaseBuildTarget }}
_Configuration: Release
_StyleCopEnabled: true
# Do CG work only in internal pipelines.
skipComponentGovernanceDetection: ${{ eq(variables['System.TeamProject'], 'public') }}
Debug:
_BuildTarget: ${{ parameters.OtherBuildTarget }}
_Configuration: Debug
_StyleCopEnabled: false
# Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
skipComponentGovernanceDetection: true
CodeAnalysis:
_BuildTarget: ${{ parameters.OtherBuildTarget }}
_Configuration: CodeAnalysis
_StyleCopEnabled: false
# Do not redo CG work. Configuration changes in this part of the matrix are not relevant to CG.
skipComponentGovernanceDetection: true

steps:
- checkout: self
clean: true
displayName: Checkout
- task: UseDotNet@2
displayName: Get .NET SDK
inputs:
useGlobalJson: true

- script: .\build.cmd EnableSkipStrongNames
displayName: Enable SkipStrongNames
- script: .\build.cmd $(_BuildTarget) /p:Desktop=false /p:BuildPortable=true ^
/binaryLogger:artifacts/msbuild.binlog /p:Configuration=$(_Configuration) /p:StyleCopEnabled=$(_StyleCopEnabled) ^
/fileLoggerParameters:LogFile=artifacts/msbuild.log;Summary;Verbosity=minimal
displayName: Build

- publish: ./bin/$(_Configuration)/Test/TestResults/
artifact: $(_Configuration) Test Results
condition: and(always(), ne(variables._BuildTarget, 'Build'))
continueOnError: true
displayName: Upload test results
- task: PublishTestResults@2
condition: and(always(), ne(variables._BuildTarget, 'Build'))
continueOnError: true
displayName: Publish test results
inputs:
mergeTestResults: true
searchFolder: ./bin/$(_Configuration)/Test/TestResults/
testResultsFiles: '*.xml'
testRunner: xUnit
testRunTitle: $(_Configuration)

- publish: ./artifacts/
artifact: $(_Configuration) Logs
condition: always()
displayName: Upload logs
2 changes: 1 addition & 1 deletion build.cmd
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ if exist "%InstallDir%\MSBuild\15.0\Bin\MSBuild.exe" (

if "%1" == "" goto BuildDefaults

%MSBuild% Runtime.msbuild /m /nr:false /t:%* /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal
%MSBuild% Runtime.msbuild /m /nr:false /p:Platform="Any CPU" /p:Desktop=true /v:M /fl /flp:LogFile=bin\msbuild.log;Verbosity=Normal /t:%*
if %ERRORLEVEL% neq 0 goto BuildFail
goto BuildSuccess

Expand Down