|
| 1 | +steps: |
| 2 | +- script: npm i -g npm@$(npm_version) |
| 3 | + displayName: Use legacy npm version $(npm_version) |
| 4 | + condition: ne(variables['npm_version'], '') |
| 5 | + |
| 6 | +- task: NodeTool@0 |
| 7 | + inputs: |
| 8 | + versionSpec: '$(node_version)' |
| 9 | + displayName: Use Node $(node_version) |
| 10 | + |
| 11 | +- script: npm install |
| 12 | + displayName: npm install |
| 13 | + |
| 14 | +- script: npm uninstall --no-save nyc && npm install --no-save nyc@latest |
| 15 | + displayName: Use latest nyc on Node.js>=12, Windows |
| 16 | + condition: and(eq('Windows_NT', variables['Agent.OS']), le(12, variables['node_version'])) |
| 17 | + |
| 18 | +- script: npm test |
| 19 | + displayName: Run tests |
| 20 | + |
| 21 | +- script: npm run coveralls |
| 22 | + displayName: Run coveralls |
| 23 | + condition: eq(variables['Build.Repository.Name'], 'gulpjs/replace-ext') |
| 24 | + env: |
| 25 | + # Pretend to be AppVeyor for now |
| 26 | + APPVEYOR: true |
| 27 | + APPVEYOR_BUILD_NUMBER: $(Build.BuildNumber) |
| 28 | + APPVEYOR_BUILD_ID: $(Agent.OS)_$(node_version) |
| 29 | + APPVEYOR_REPO_COMMIT: $(Build.SourceVersion) |
| 30 | + APPVEYOR_REPO_BRANCH: $(Build.SourceBranchName) |
| 31 | + # Overwrite the AppVeyor Service Name |
| 32 | + COVERALLS_SERVICE_NAME: Azure Pipelines |
| 33 | + COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) |
| 34 | + COVERALLS_PARALLEL: true |
| 35 | + CI_PULL_REQUEST: $(System.PullRequest.PullRequestNumber) |
| 36 | + |
| 37 | +- script: npm run azure-pipelines |
| 38 | + displayName: Write tests to xml |
| 39 | + |
| 40 | +- task: PublishTestResults@2 |
| 41 | + inputs: |
| 42 | + testResultsFiles: '**/test.xunit' |
| 43 | + condition: succeededOrFailed() |
0 commit comments