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: Migrate to 1ES pipelines #1470

Merged
merged 2 commits into from
Jan 18, 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
241 changes: 122 additions & 119 deletions .azure-pipelines/vscode-gradle-ci.yml
Original file line number Diff line number Diff line change
@@ -1,121 +1,124 @@
# 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

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:
- main
- develop

jobs:
- job: cred_scan
displayName: Cred Scan
branches:
include:
- develop
extends:
template: v1/1ES.Unofficial.PipelineTemplate.yml@1esPipelines
parameters:
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: 15023
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
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@2
displayName: Build
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)'
- task: PublishBuildArtifacts@1
displayName: Publish VSIX
inputs:
ArtifactName: extension
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 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: 16492
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
- task: JavaToolInstaller@0
displayName: Install Java 17
inputs:
versionSpec: '17'
jdkArchitectureOption: 'x64'
jdkSourceOption: 'PreInstalled'
- task: Gradle@2
displayName: Build
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)'
Loading
Loading