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

Clean up APIScan and other compliance yaml #2802

Merged
merged 1 commit into from
Mar 25, 2024
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
28 changes: 26 additions & 2 deletions scripts/azure-pipelines-complete-internal.yml
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,12 @@ parameters:
name: Azure Pipelines
vmImage: ubuntu-20.04
os: linux
- name: enableSigning
displayName: 'Enable package signing (Test signing)'
type: boolean
default: false
- name: runCompliance
displayName: 'Run post-build compliance tasks (such as API Scan)'
displayName: 'Run post-build compliance tasks (such as API Scan and PoliCheck)'
type: boolean
default: false
- name: use1ESPipelineTemplates
Expand Down Expand Up @@ -77,7 +81,27 @@ extends:
parameters:
buildPipelineType: 'both'
buildExternals: ${{ parameters.buildExternals }}
runCompliance: ${{ parameters.runCompliance }}
enableSigning: ${{ parameters.enableSigning }}
${{ if eq(parameters.runCompliance, 'true') }}:
sdl:
apiscan:
enabled: true
binskim:
break: false
codeInspector:
enabled: true
credscan:
suppressionsFile: $(Build.SourcesDirectory)\scripts\guardian\CredScanSuppressions.json
policheck:
enabled: true
exclusionsFile: $(Build.SourcesDirectory)\scripts\guardian\PoliCheckExclusions.xml
spotBugs:
enabled: false
suppression:
suppressionFile: $(Build.SourcesDirectory)\scripts\guardian\source.gdnsuppress
tsa:
enabled: true
configFile: $(Build.SourcesDirectory)\scripts\guardian\tsaoptions-v2.json
use1ESPipelineTemplates: ${{ parameters.use1ESPipelineTemplates }}
buildAgentHost: ${{ parameters.buildAgentHost }}
buildAgentWindows: ${{ parameters.buildAgentWindows }}
Expand Down
27 changes: 25 additions & 2 deletions scripts/azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ parameters:
image: 1ESPT-Ubuntu20.04
os: linux
- name: runCompliance
displayName: 'Run post-build compliance tasks (such as API Scan)'
displayName: 'Run post-build compliance tasks (such as API Scan and PoliCheck)'
type: boolean
default: false

Expand Down Expand Up @@ -76,7 +76,30 @@ extends:
parameters:
buildPipelineType: 'build'
buildExternals: ${{ parameters.buildExternals }}
runCompliance: ${{ parameters.runCompliance }}
${{ if and(eq(variables['System.TeamProject'], 'devdiv'), ne(variables['System.PullRequest.IsFork'], 'true')) }}:
enableSigning: true
${{ if or(parameters.runCompliance, and(eq(variables['Build.Reason'], 'Schedule'), or(eq(variables['Build.SourceBranch'], 'refs/heads/main'), startsWith(variables['Build.SourceBranch'], 'refs/heads/release/')))) }}:
sdl:
apiscan:
enabled: true
binskim:
enabled: true
break: false
codeInspector:
enabled: true
credscan:
enabled: true
# suppressionsFile: $(Build.SourcesDirectory)\scripts\guardian\CredScanSuppressions.json
policheck:
enabled: true
exclusionsFile: $(Build.SourcesDirectory)\scripts\guardian\PoliCheckExclusions.xml
spotBugs:
enabled: false
suppression:
suppressionFile: $(Build.SourcesDirectory)\scripts\guardian\source.gdnsuppress
tsa:
enabled: true
configFile: $(Build.SourcesDirectory)\scripts\guardian\tsaoptions-v2.json
use1ESPipelineTemplates: true
buildAgentHost: ${{ parameters.buildAgentHost }}
buildAgentWindows: ${{ parameters.buildAgentWindows }}
Expand Down
7 changes: 2 additions & 5 deletions scripts/azure-templates-bootstrapper.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ parameters:
skipInstall: false # whether or not to install any tools
skipSteps: false # whether or not to run any steps
use1ESPipelineTemplates: false # whether or not we are building using the internal 1ES Pipeline Templates
sdl: [] # the SDL properties to use for this job

jobs:
- job: ${{ parameters.name }}
Expand All @@ -49,11 +50,7 @@ jobs:
${{ if ne(length(parameters.variables), 0) }}:
${{ parameters.variables }}
templateContext:
sdl:
spotBugs:
enabled: false
binskim:
break: false
sdl: ${{ parameters.sdl }}
outputParentDirectory: 'output'
outputs:
- ${{ if eq(parameters.shouldPublish, 'true') }}:
Expand Down
2 changes: 2 additions & 0 deletions scripts/azure-templates-linux-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ parameters:
buildPipelineType: 'both' # the type of build pipeline setup
buildAgent: '' # the configuration for the build agent
use1ESPipelineTemplates: false # whether or not we are building using the internal 1ES Pipeline Templates
sdl: [] # the SDL properties to use for this job
builds:
- name: ''
desc: ''
Expand All @@ -24,6 +25,7 @@ jobs:
parameters:
name: ${{ replace(replace(format('native_linux_{0}_{1}_{2}_{3}_linux', item.arch, item.variant, build.name, item.alt), '__', '_'), '__', '_') }}
displayName: Linux ${{ replace(replace(replace(replace(replace(format('({0}|{1}|{2}|{3})', item.arch, item.variant, build.name, item.alt), '||', '|'), '||', '|'), '(|', '('), '|)', ')'), '|', ', ') }}
sdl: ${{ parameters.sdl }}
buildExternals: ${{ parameters.buildExternals }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgent }}
Expand Down
2 changes: 2 additions & 0 deletions scripts/azure-templates-merger.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,14 @@ parameters:
buildPipelineType: 'both' # the type of build pipeline setup
requiredArtifacts: [] # the artifacts that this build needs to download
matrixArtifacts: [] # the artifacts that this build needs to download
sdl: [] # the SDL properties to use for this job

jobs:
- template: /scripts/azure-templates-bootstrapper.yml@self
parameters:
name: ${{ parameters.name }}
displayName: ${{ parameters.displayName }}
sdl: ${{ parameters.sdl }}
buildPipelineType: ${{ parameters.buildPipelineType }}
buildAgent: ${{ parameters.buildAgent }}
skipInstall: true
Expand Down
Loading
Loading