Skip to content
This repository has been archived by the owner on Jul 18, 2022. It is now read-only.

Commit

Permalink
templating the build up a bit
Browse files Browse the repository at this point in the history
  • Loading branch information
aaronpowell committed Jun 28, 2019
1 parent e374de3 commit 5e19279
Show file tree
Hide file tree
Showing 5 changed files with 77 additions and 114 deletions.
18 changes: 18 additions & 0 deletions .azure-pipelines/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
steps:
- task: NodeTool@0
displayName: 'Use $(node_version)'
inputs:
versionSpec: $(node_version)

- task: Npm@1
displayName: 'Install dependencies'
inputs:
verbose: false
command: install

- task: Npm@1
displayName: 'Compile Extension'
inputs:
command: custom
verbose: false
customCommand: 'run compile'
6 changes: 6 additions & 0 deletions .azure-pipelines/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
steps:
- task: Npm@1
displayName: 'Lint'
inputs:
command: custom
customCommand: run lint
11 changes: 11 additions & 0 deletions .azure-pipelines/package.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
steps:
- script: |
npx vsce package -o release.vsix
displayName: 'create vsix'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: release.vsix
condition: and(succeeded(), eq(variables['node_version'], '12.x'))

24 changes: 24 additions & 0 deletions .azure-pipelines/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
steps:
# starts a process that allows the vscode test environment to run
- script: |
set -e
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 &
disown -ar
displayName: 'Start xvfb'
condition: eq(variables['Agent.OS'], 'Linux')
- task: Npm@1
displayName: 'Run tests via npm script'
inputs:
command: custom
verbose: false
customCommand: 'run test:ci'
env:
DISPLAY: :10

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*-results.xml'
testRunTitle: '$(Agent.OS)'
condition: succeededOrFailed()
132 changes: 18 additions & 114 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
Expand Up @@ -17,129 +17,33 @@ jobs:
node_12_x:
node_version: 12.x
steps:
- task: NodeTool@0
displayName: 'Use $(node_version)'
inputs:
versionSpec: $(node_version)

- task: Npm@1
displayName: 'Install dependencies'
inputs:
verbose: false
command: install

- task: Npm@1
displayName: 'Compile Extension'
inputs:
command: custom
verbose: false
customCommand: 'run compile'

# starts a process that allows the vscode test environment to run
- script: |
set -e
/usr/bin/Xvfb :10 -ac >> /tmp/Xvfb.out 2>&1 &
disown -ar
displayName: 'Start xvfb'
- task: Npm@1
displayName: 'Run tests via npm script'
inputs:
command: custom
verbose: false
customCommand: 'run test:ci'
env:
DISPLAY: :10

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*-results.xml'
testRunTitle: '$(Agent.OS)'
condition: succeededOrFailed()

- script: |
npx vsce package -o release.vsix
displayName: 'create vsix'
- task: PublishPipelineArtifact@0
displayName: 'Publish Pipeline Artifact'
inputs:
targetPath: release.vsix
condition: and(succeeded(), eq(variables['node_version'], '12.x'))
- template: .azure-pipelines/build.yml
- template: .azure-pipelines/lint.yml
- template: .azure-pipelines/test.yml
- template: .azure-pipelines/package.yml

- job: Windows
pool:
name: Hosted VS2017
demands: npm
strategy:
matrix:
node_10_x:
node_version: 10.x
steps:
- task: NodeTool@0
displayName: 'Use Node 10.x'
inputs:
versionSpec: 10.x

- task: Npm@1
displayName: 'Install dependencies'
inputs:
verbose: false
command: install

- task: Npm@1
displayName: 'Compile Extension'
inputs:
command: custom
verbose: false
customCommand: 'run compile'

- task: Npm@1
displayName: 'Run tests via npm script'
inputs:
command: custom
verbose: false
customCommand: 'run test:ci'
env:
DISPLAY: :10

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*-results.xml'
testRunTitle: '$(Agent.OS)'
condition: succeededOrFailed()
- template: .azure-pipelines/build.yml
- template: .azure-pipelines/lint.yml
- template: .azure-pipelines/test.yml

- job: macOS
pool:
name: Hosted macOS
demands: npm
strategy:
matrix:
node_10_x:
node_version: 10.x
steps:
- task: NodeTool@0
displayName: 'Use Node 10.x'
inputs:
versionSpec: 10.x

- task: Npm@1
displayName: 'Install dependencies'
inputs:
verbose: false
command: install

- task: Npm@1
displayName: 'Compile Extension'
inputs:
command: custom
verbose: false
customCommand: 'run compile'

- task: Npm@1
displayName: 'Run tests via npm script'
inputs:
command: custom
verbose: false
customCommand: 'run test:ci'

- task: PublishTestResults@2
displayName: 'Publish Test Results'
inputs:
testResultsFiles: '*-results.xml'
testRunTitle: '$(Agent.OS)'
condition: succeededOrFailed()
- template: .azure-pipelines/build.yml
- template: .azure-pipelines/lint.yml
- template: .azure-pipelines/test.yml

0 comments on commit 5e19279

Please # to comment.