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

build: Add APIScan task to CI pipelines #1476

Merged
merged 1 commit into from
Mar 6, 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
46 changes: 32 additions & 14 deletions .azure-pipelines/vscode-gradle-nightly.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ extends:
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
os: linux
image: 1ES_JavaTooling_Windows_2022
os: windows
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
spotBugs:
enabled: false
stages:
- stage: Build
jobs:
Expand Down Expand Up @@ -63,14 +65,13 @@ extends:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'prepareForRelease'
- bash: |
cd $(Build.SourcesDirectory)/extension/lib
chmod +x gradle-server
- bash: chmod +x gradle-server
workingDirectory: $(Build.SourcesDirectory)/extension/lib
displayName: Set permission
- task: EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'vscjavaci_codesign'
ConnectedServiceName: 'vscjavaci_esrp_codesign'
FolderPath: 'extension/lib'
Pattern: 'gradle-server.jar'
signConfigType: 'inlineSignParams'
Expand All @@ -94,14 +95,13 @@ extends:
"ToolVersion" : "1.0"
}
]
- bash: |
cd $(Build.SourcesDirectory)/extension
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
- bash: npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Replace AI Key
- bash: |
cd $(Build.SourcesDirectory)/extension
node ./scripts/prepare-nightly-build.js
mv ./package.insiders.json ./package.json
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Generate new package.json
- task: ComponentGovernanceComponentDetection@0
inputs:
Expand Down Expand Up @@ -146,7 +146,7 @@ extends:
- task: EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'vscjavaci_codesign'
ConnectedServiceName: 'vscjavaci_esrp_codesign'
FolderPath: 'extension/server'
Pattern: 'com.microsoft.gradle.bs.importer-*.jar'
signConfigType: 'inlineSignParams'
Expand All @@ -170,10 +170,28 @@ extends:
"ToolVersion" : "1.0"
}
]
- bash: |
cd $(Build.SourcesDirectory)/extension
npx @vscode/vsce@latest package --pre-release
- bash: npx @vscode/vsce@latest package --pre-release
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
### Copy files for APIScan
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "extension/*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-gradle"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Expand Down
43 changes: 30 additions & 13 deletions .azure-pipelines/vscode-gradle-rc.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,13 +20,15 @@ extends:
parameters:
pool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
os: linux
image: 1ES_JavaTooling_Windows_2022
os: windows
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
spotBugs:
enabled: false
stages:
- stage: Build
jobs:
Expand Down Expand Up @@ -63,14 +65,13 @@ extends:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'prepareForRelease'
- bash: |
cd $(Build.SourcesDirectory)/extension/lib
chmod +x gradle-server
- bash: chmod +x gradle-server
workingDirectory: $(Build.SourcesDirectory)/extension/lib
displayName: Set permission
- task: EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'vscjavaci_codesign'
ConnectedServiceName: 'vscjavaci_esrp_codesign'
FolderPath: 'extension/lib'
Pattern: 'gradle-server.jar'
signConfigType: 'inlineSignParams'
Expand All @@ -94,9 +95,8 @@ extends:
"ToolVersion" : "1.0"
}
]
- bash: |
cd $(Build.SourcesDirectory)/extension
npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
- bash: npx json@latest -I -f package.json -e "this.aiKey=\"$(AI_KEY)\""
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Replace AI Key
- task: ComponentGovernanceComponentDetection@0
inputs:
Expand Down Expand Up @@ -141,7 +141,7 @@ extends:
- task: EsrpCodeSigning@2
displayName: 'ESRP CodeSigning'
inputs:
ConnectedServiceName: 'vscjavaci_codesign'
ConnectedServiceName: 'vscjavaci_esrp_codesign'
FolderPath: 'extension/server'
Pattern: 'com.microsoft.gradle.bs.importer-*.jar'
signConfigType: 'inlineSignParams'
Expand All @@ -165,10 +165,27 @@ extends:
"ToolVersion" : "1.0"
}
]
- bash: |
cd $(Build.SourcesDirectory)/extension
npx @vscode/vsce@latest package
- bash: npx @vscode/vsce@latest package
workingDirectory: $(Build.SourcesDirectory)/extension
displayName: Package VSIX
- task: CopyFiles@2
displayName: "Copy Files for APIScan"
inputs:
Contents: "extension/*.vsix"
TargetFolder: $(Agent.TempDirectory)/APIScanFiles
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
### Run latest version of APIScan listed at https://www.1eswiki.com/wiki/APIScan_Build_Task
- task: APIScan@2
displayName: Run APIScan
inputs:
softwareFolder: $(Agent.TempDirectory)/APIScanFiles
softwareName: "vscode-gradle"
softwareVersionNum: "$(Build.BuildId)"
isLargeApp: false
toolVersion: "Latest"
condition: and(succeeded(), ne(variables['DisableAPIScan'], 'true'))
env:
AzureServicesAuthConnectionString: runAs=App;AppId=$(ApiScanClientId);TenantId=$(ApiScanTenant);AppKey=$(ApiScanSecret)
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Expand Down
Loading