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

117 строки
4.4 KiB
YAML

name: $(Date:yyyyMMdd).$(Rev:r)
resources:
repositories:
- repository: self
type: git
ref: refs/heads/main
- repository: 1esPipelines
type: git
name: 1ESPipelineTemplates/1ESPipelineTemplates
ref: refs/tags/release
trigger:
branches:
include:
- develop
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
pool:
os: linux
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Ubuntu-2004
sdl:
sourceAnalysisPool:
name: 1ES_JavaTooling_Pool
image: 1ES_JavaTooling_Windows_2022
os: windows
stages:
- stage: Build
jobs:
- job: Job_1
displayName: VSCode-Gradle-CI
templateContext:
outputs:
- output: pipelineArtifact
artifactName: extension
targetPath: $(Build.ArtifactStagingDirectory)
displayName: "Publish Artifact: extension"
steps:
- checkout: self
fetchTags: false
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: NodeTool@0
displayName: Install Node 18.x
inputs:
versionSpec: 18.x
- task: DownloadBuildArtifacts@1
displayName: 'Download Build Server Artifacts'
inputs:
buildType: specific
project: 'a4d27ce2-a42d-4b71-8eef-78cee9a9728e'
pipeline: 16492
downloadType: specific
extractTars: false
- task: CopyFiles@2
displayName: 'Copy Build Server Plugin Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs/plugins'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/extension/server/plugins
- task: CopyFiles@2
displayName: 'Copy Build Server Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs'
Contents: 'server.jar'
TargetFolder: $(Build.SourcesDirectory)/gradle-server/build/libs
- task: CopyFiles@2
displayName: 'Copy Build Server Runtime Artifacts'
inputs:
SourceFolder: '$(System.ArtifactsDirectory)/build-server/server/build/libs/runtime'
Contents: '**'
TargetFolder: $(Build.SourcesDirectory)/gradle-server/build/libs/runtime
- 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: Gradle@2
displayName: Build Gradle Build Server Importer
inputs:
gradleWrapperFile: 'gradlew'
gradleOptions: '-Xmx3072m'
tasks: ':extension:copyJdtlsPluginJar'
- bash: |
cd $(Build.SourcesDirectory)/extension
npx @vscode/vsce@latest package
displayName: Package VSIX
- task: CopyFiles@2
displayName: Copy VSIX
inputs:
Contents: 'extension/*.vsix'
TargetFolder: '$(Build.ArtifactStagingDirectory)'