forked from ajshort/vscode-ros
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
create build and test pipeline with Azure Pipelines (#21)
* add azure-pipelines.yml * update pipelines.yml * update build.yml according to vscode sample * correc to use vmImage for windows-2019 * update compile command to build only once * fix typo for run tests command * move steps into templates * update template file path * update template file path * update template file path * update templates and add file associations * try run test script in document * xvfb related changes for tests on Linux * update yml * update gitignore to ignore .vscode-test * move package to separate step * update job names * turn off verbose flag for npm commands * add triggers * make publish artiface one of the steps
- Loading branch information
Showing
9 changed files
with
183 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,6 @@ | ||
# node.js | ||
out | ||
node_modules | ||
|
||
# vscode-test | ||
.vscode-test |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,87 @@ | ||
name: $(BuildID).$(Date:yyMMdd)$(Rev:.r) | ||
|
||
# auto-trigger build on merge | ||
trigger: | ||
batch: false | ||
branches: | ||
include: | ||
[ | ||
'master', | ||
] | ||
paths: | ||
exclude: | ||
[ | ||
'.vscode', | ||
'.github', | ||
'*.md', | ||
] | ||
|
||
# auto-trigger build on pull request | ||
pr: | ||
branches: | ||
include: | ||
[ | ||
'master', | ||
] | ||
paths: | ||
exclude: | ||
[ | ||
'.vscode', | ||
'.github', | ||
'*.md', | ||
] | ||
|
||
variables: | ||
nodeVersion: '>=10.15.3' | ||
npmVersion: 'latest' | ||
|
||
jobs: | ||
- job: Build_Ubuntu | ||
pool: | ||
vmImage: 'ubuntu-16.04' | ||
demands: npm | ||
steps: | ||
- template: templates/setup-environment.yml | ||
- template: templates/install-dependencies.yml | ||
- template: templates/compile.yml | ||
- script: | | ||
set -e | ||
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 & | ||
disown -ar | ||
displayName: 'Start xvfb' | ||
- script: 'node node_modules/vscode/bin/test' | ||
displayName: 'Run tests' | ||
env: | ||
DISPLAY: :10 | ||
|
||
- job: Build_macOS | ||
pool: | ||
vmImage: 'macOS-10.14' | ||
demands: npm | ||
steps: | ||
- template: templates/setup-environment.yml | ||
- template: templates/install-dependencies.yml | ||
- template: templates/compile.yml | ||
- script: | | ||
node node_modules/vscode/bin/test | ||
displayName: 'Run tests' | ||
- job: Build_Windows | ||
dependsOn: | ||
[ | ||
'Build_Ubuntu', | ||
'Build_macOS', | ||
] | ||
pool: | ||
vmImage: 'windows-2019' | ||
demands: npm | ||
steps: | ||
- template: templates/setup-environment.yml | ||
- template: templates/install-dependencies.yml | ||
- template: templates/compile.yml | ||
- script: | | ||
node node_modules/vscode/bin/test | ||
displayName: 'Run tests' | ||
# only publish artifact once | ||
- template: templates/package-artifact.yml |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
steps: | ||
- task: Npm@1 | ||
displayName: 'Compile sources' | ||
inputs: | ||
command: custom | ||
verbose: false | ||
customCommand: | | ||
run buildOnce |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
steps: | ||
- task: Npm@1 | ||
displayName: 'Install dependencies with package-lock.json' | ||
inputs: | ||
command: custom | ||
verbose: false | ||
customCommand: | | ||
ci |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
steps: | ||
- script: | | ||
npm install --global vsce | ||
displayName: 'Install vsce' | ||
# condition: | ||
# and( | ||
# succeeded(), | ||
# eq(variables['build'], 'true') | ||
# ) | ||
- script: | | ||
npm run package:dev | ||
displayName: 'Create dev-version .vsix package' | ||
# condition: | ||
# and( | ||
# succeeded(), | ||
# eq(variables['build'], 'true') | ||
# ) | ||
- task: CopyFiles@2 | ||
inputs: | ||
contents: "*.vsix" | ||
targetFolder: $(Build.ArtifactStagingDirectory) | ||
displayName: "Stage .vsix" | ||
# condition: | ||
# and( | ||
# succeeded(), | ||
# eq(variables['build'], 'true') | ||
# ) | ||
|
||
- task: PublishBuildArtifacts@1 | ||
inputs: | ||
pathtoPublish: $(Build.ArtifactStagingDirectory) | ||
artifactName: VSIX | ||
displayName: "Publish .vsix to Arifacts" | ||
# condition: | ||
# and( | ||
# succeeded(), | ||
# eq(variables['build'], 'true') | ||
# ) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
# steps: | ||
# - task: PublishTestResults@2 | ||
# displayName: 'Publish tests results' | ||
# inputs: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
steps: | ||
- bash: | | ||
printenv | ||
displayName: 'Dump environment variables' | ||
condition: and(succeeded(), eq(variables['system.debug'], 'true')) | ||
- task: NodeTool@0 | ||
displayName: 'Use Node version: $(nodeVersion)' | ||
inputs: | ||
versionSpec: $(nodeVersion) | ||
|
||
- task: Npm@1 | ||
displayName: "Use NPM version: $(npmVersion)" | ||
inputs: | ||
command: custom | ||
verbose: false | ||
customCommand: | | ||
install -g npm@$(npmVersion) | ||
- bash: | | ||
echo Node Version = `node --version` | ||
echo NPM Version = `npm --version` | ||
displayName: 'Check environment versions' | ||
condition: and(succeeded(), eq(variables['system.debug'], 'true')) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters