|
| 1 | +# Node.js |
| 2 | +# Build a general Node.js project with npm. |
| 3 | +# Add steps that analyze code, save build artifacts, deploy, and more: |
| 4 | +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript |
| 5 | + |
| 6 | +trigger: |
| 7 | + - master |
| 8 | + |
| 9 | +jobs: |
| 10 | + - job: lint |
| 11 | + displayName: Lint code |
| 12 | + pool: |
| 13 | + vmImage: Ubuntu-16.04 |
| 14 | + steps: |
| 15 | + - task: NodeTool@0 |
| 16 | + displayName: Install Node.js |
| 17 | + inputs: |
| 18 | + versionSpec: 12.x |
| 19 | + - script: npm install |
| 20 | + displayName: Install packages |
| 21 | + - script: npm run -s lint |
| 22 | + displayName: Lint code |
| 23 | + |
| 24 | + - job: tests_on_linux |
| 25 | + displayName: Test on Linux |
| 26 | + pool: |
| 27 | + vmImage: 'Ubuntu-16.04' |
| 28 | + strategy: |
| 29 | + matrix: |
| 30 | + "Node.js v12": |
| 31 | + node_version: 12.x |
| 32 | + "Node.js v10": |
| 33 | + node_version: 10.x |
| 34 | + "Node.js v8.10.0": |
| 35 | + node_version: "8.10.0" |
| 36 | + steps: |
| 37 | + - task: NodeTool@0 |
| 38 | + displayName: Install Node.js |
| 39 | + inputs: |
| 40 | + versionSpec: $(node_version) |
| 41 | + - script: npm install && npm install --no-save async |
| 42 | + displayName: Install Packages |
| 43 | + - script: npm test |
| 44 | + displayName: Test |
| 45 | + - script: npm run -s codecov |
| 46 | + displayName: Send Coverage |
| 47 | + |
| 48 | + - job: tests_on_windows |
| 49 | + displayName: Test on Windows |
| 50 | + pool: |
| 51 | + vmImage: 'Windows-2019' |
| 52 | + steps: |
| 53 | + - task: NodeTool@0 |
| 54 | + displayName: Install Node.js |
| 55 | + inputs: |
| 56 | + versionSpec: 12.x |
| 57 | + - script: npm install && npm install --no-save async |
| 58 | + displayName: Install Packages |
| 59 | + - script: npm test |
| 60 | + displayName: Test |
| 61 | + - script: npm run -s codecov |
| 62 | + displayName: Send Coverage |
| 63 | + |
| 64 | + - job: tests_on_macos |
| 65 | + displayName: Test on macOS |
| 66 | + pool: |
| 67 | + vmImage: 'macOS-10.14' |
| 68 | + steps: |
| 69 | + - task: NodeTool@0 |
| 70 | + displayName: Install Node.js |
| 71 | + inputs: |
| 72 | + versionSpec: 12.x |
| 73 | + - script: npm install && npm install --no-save async |
| 74 | + displayName: Install Packages |
| 75 | + - script: npm test |
| 76 | + displayName: Test |
| 77 | + - script: npm run -s codecov |
| 78 | + displayName: Send Coverage |
0 commit comments