Skip to content
Merged
Show file tree
Hide file tree
Changes from 1 commit
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
Next Next commit
[ci] Add ApiScan.
  • Loading branch information
jpobst committed Dec 15, 2023
commit d3754c87b6985080cfefdda102cacdd01f1aec9e
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)
7 changes: 6 additions & 1 deletion build/ci/build.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
parameters:
# Environment Parameters
name: 'build' # the name of the build job for dependency purposes
timeoutInMinutes: 150 # the timeout in minutes
timeoutInMinutes: 180 # the timeout in minutes
mainBranchName: 'main' # the "main" branch that should be used - can be something other than "main"
macosAgentPoolName: 'Azure Pipelines' # the name of the macOS VM pool
macosImage: internal-macos12 # macOS VM image name, must be "internal" locked down image
Expand Down 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