-
Notifications
You must be signed in to change notification settings - Fork 240
Expand file tree
/
Copy pathci-build-production.yml
More file actions
88 lines (76 loc) · 2.08 KB
/
Copy pathci-build-production.yml
File metadata and controls
88 lines (76 loc) · 2.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
# Node.js
# Build a general Node.js project with npm.
# Add steps that analyze code, save build artifacts, deploy, and more:
# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript
name: $(BuildDefinitionName)_$(SourceBranchName)_$(Date:yyyyMMdd)$(Rev:.r)
trigger:
branches:
include:
- main
pr: none
stages:
- stage: "Test"
jobs:
- job:
pool:
vmImage: windows-latest
strategy:
matrix:
Node 12:
NODE_VERSION: '12.x'
Node 14:
NODE_VERSION: '14.x'
Node 16:
NODE_VERSION: '16.x'
maxParallel: 2
steps:
- template: ./common-templates/security-pre-checks.yml
- task: NodeTool@0
inputs:
versionSpec: $(NODE_VERSION)
displayName: 'Install Node.js'
- script: npm ci
displayName: 'npm install for tests'
- script: npm run build
displayName: 'npm build for tests'
- script: npm run test
displayName: 'Run the node tests'
- script: npm run karma
displayName: 'Run karma tests'
- task: PublishTestResults@2
displayName: 'Publish Unit Test Results'
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/testResult.xml'
failTaskOnFailedTests: true
- template: ./common-templates/security-post-checks.yml
- stage: "Build"
jobs:
- job:
pool:
vmImage: ubuntu-latest
steps:
- task: NodeTool@0
inputs:
versionSpec: '16.x'
displayName: 'Install Node.js'
- script: |
npm ci
npm run build
displayName: 'Build for production artifact'
- task: CopyFiles@2
inputs:
sourceFolder: '$(Build.SourcesDirectory)'
targetFolder: $(Build.ArtifactStagingDirectory)
Contents: |
**/*
!.azure-pipelines/**
!.github/**
!.git/**
!.vscode/**
displayName: 'Copy npm package'
- task: PublishBuildArtifacts@1
inputs:
pathtoPublish: $(Build.ArtifactStagingDirectory)
artifactName: "release-drop"
displayName: 'Publish artifacts'