Skip to content
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
37 changes: 37 additions & 0 deletions build/ci/api-scan.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
parameters:
apiScanDirectory: $(Agent.TempDirectory)\APIScanFiles # The directory to copy and scan assemblies
mainBranchName: # The "main" branch that should be used - can be something other than "main"

steps:

### Copy .dll and .pdb files for APIScan
- task: CopyFiles@2
displayName: 'Collect Files for APIScan'
inputs:
Contents: |
generated\**\bin\Release\**\?(*.dll|*.pdb)
util\**\bin\Release\**\?(*.dll|*.pdb)
TargetFolder: ${{ parameters.apiScanDirectory }}
OverWrite: true
flattenFolders: true
condition: and(succeeded(), eq(variables['runAPIScan'], 'true'), eq('refs/heads/${{ parameters.mainBranchName }}', variables['Build.SourceBranch']))

- task: CmdLine@2
displayName: 'List Files for APIScan'
inputs:
script: |
tree ${{ parameters.apiScanDirectory }} /f
condition: and(succeeded(), eq(variables['runAPIScan'], 'true'), eq('refs/heads/${{ parameters.mainBranchName }}', variables['Build.SourceBranch']))

### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: ${{ parameters.apiScanDirectory }}
softwareName: $(ApiScanName)
softwareVersionNum: '$(Build.BuildId)'
isLargeApp: true
toolVersion: Latest
condition: and(succeeded(), eq(variables['runAPIScan'], 'true'), eq('refs/heads/${{ parameters.mainBranchName }}', variables['Build.SourceBranch']))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
5 changes: 5 additions & 0 deletions build/ci/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ jobs:
imageName: ${{ parameters.windowsImage }}
classicInstallerUrl: ${{ parameters.classicXAVsix }}
runCodeQL: true
runAPIScan: true
displayName: Build
timeoutInMinutes: ${{ parameters.timeoutInMinutes }}
variables:
Expand All @@ -73,6 +74,10 @@ jobs:
configuration: ${{ parameters.configuration }}
skipUnitTests: ${{ parameters.skipUnitTests }}

- template: api-scan.yml
parameters:
mainBranchName: ${{ parameters.mainBranchName }}

# after the build is complete
- pwsh: |
$srcExists = (Test-Path "${{ parameters.signListPath }}")
Expand Down