-
Notifications
You must be signed in to change notification settings - Fork 117
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
3d6018a
commit 81c3529
Showing
1 changed file
with
37 additions
and
41 deletions.
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,46 +1,42 @@ | ||
pool: | ||
vmImage: ubuntu-20.04 | ||
vmImage: ubuntu-18.04 | ||
|
||
parameters: | ||
- name: versionSpec | ||
type: object | ||
default: | ||
- '6.x' | ||
- '8.x' | ||
- '10.x' | ||
- '12.x' | ||
- '14.x' | ||
strategy: | ||
matrix: | ||
'Node 6': | ||
versionSpec: '6.x' | ||
'Node 8': | ||
versionSpec: '8.x' | ||
'Node 10': | ||
versionSpec: '10.x' | ||
'Node 12': | ||
versionSpec: '12.x' | ||
'Node 14': | ||
versionSpec: '14.x' | ||
|
||
jobs: | ||
- job: build_test_and_publish | ||
displayName: Build, test and publish | ||
steps: | ||
#build on node 8.x | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: '8.x' | ||
displayName: Install node | ||
steps: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: $(versionSpec) | ||
displayName: Install node | ||
|
||
- script: npm install | ||
displayName: npm install | ||
- script: npm install | ||
displayName: npm install | ||
|
||
- script: npm run build | ||
displayName: npm run build | ||
#run unit tests on different node versions | ||
- ${{ each version in parameters.versionSpec }}: | ||
- task: NodeTool@0 | ||
inputs: | ||
versionSpec: ${{ version }} | ||
displayName: Install node | ||
- script: npm run units | ||
displayName: npm run units | ||
- script: npm run test | ||
displayName: npm run test | ||
#publish if needed | ||
- task: PublishBuildArtifacts@1 | ||
condition: and(succeeded(), in(variables['publishBuild'], 'true')) | ||
inputs: | ||
PathtoPublish: "_build" | ||
ArtifactName: "drop" | ||
ArtifactType: "Container" | ||
displayName: Publish build artifacts | ||
- script: npm run build | ||
displayName: npm run build | ||
|
||
- script: npm run units | ||
displayName: npm run units | ||
|
||
- script: npm run test | ||
displayName: npm run test | ||
|
||
#publish if needed | ||
- task: PublishBuildArtifacts@1 | ||
condition: and(succeeded(), in(variables['publishBuild'], 'true')) | ||
inputs: | ||
PathtoPublish: "_build" | ||
ArtifactName: "drop" | ||
ArtifactType: "Container" | ||
displayName: Publish build artifacts |