vscode-gradle/.azure-pipelines/vscode-gradle-ci.yml

110 строки
3.3 KiB
YAML

# Gradle
# Build your Java project and run tests with Gradle using a Gradle wrapper script.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/java
trigger:
- main
- develop
jobs:
- job: cred_scan
displayName: Cred Scan
pool:
vmImage: 'windows-latest'
steps:
- task: securedevelopmentteam.vss-secure-development-tools.build-task-credscan.CredScan@2
displayName: 'Run CredScan'
inputs:
toolMajorVersion: V2
verboseOutput: true
debugMode: false
- task: securedevelopmentteam.vss-secure-development-tools.build-task-postanalysis.PostAnalysis@1
displayName: 'Post Analysis'
inputs:
CredScan: true
- job: ci
dependsOn: cred_scan
displayName: VSCode-Gradle-CI
pool:
vmImage: 'ubuntu-latest'
steps:
- task: JavaToolInstaller@0
displayName: Install Java 11
inputs:
versionSpec: '11'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: NodeTool@0
displayName: Install Node 16.14.2
inputs:
versionSpec: '16.14.2'
- task: Gradle@2
displayName: Build
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'build'
- task: CmdLine@2
displayName: Start Xvfb
inputs:
script: |
sudo apt-get update
sudo apt-get install -y libxkbfile-dev pkg-config libsecret-1-dev libxss1 dbus xvfb libgtk-3-0 libgbm1
sudo /usr/bin/Xvfb :99 -screen 0 1024x768x24 > /dev/null 2>&1 &
- task: Gradle@2
displayName: Test VSCode
env:
DISPLAY: ":99.0"
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: 'testVsCode'
- bash: |
cd $(Build.SourcesDirectory)/extension/lib
chmod +x gradle-server
displayName: Set permission
- task: ComponentGovernanceComponentDetection@0
inputs:
scanType: 'Register'
verbosity: 'Verbose'
alertWarningLevel: 'High'
- task: notice@0
displayName: 'NOTICE File Generator'
inputs:
outputformat: 'text'
- task: DownloadPipelineArtifact@2
displayName: Download NOTICE file
inputs:
artifact: 'NOTICE.txt'
path: $(Build.SourcesDirectory)/extension
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 14788
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server
- bash: |
cd $(Build.SourcesDirectory)/extension
npx vsce@latest package
displayName: Package VSIX
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Contents: 'extension/*.vsix'
TargetFolder: '$(Build.ArtifactStagingDirectory)'
- task: PublishBuildArtifacts@1
displayName: Publish VSIX
inputs:
ArtifactName: extension