Set up CI with Azure Pipelines
This commit is contained in:
parent
2ca015c4c5
commit
9ab8d29e43
5 changed files with 81 additions and 3 deletions
34
.azure-pipelines-steps.yml
Normal file
34
.azure-pipelines-steps.yml
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
steps:
|
||||
- task: NodeTool@0
|
||||
inputs:
|
||||
versionSpec: $(NODE_VERSION)
|
||||
displayName: 'Install Node.js'
|
||||
|
||||
- script: npm install
|
||||
displayName: 'Install dependencies (npm install)'
|
||||
|
||||
- script: npm run test:lint
|
||||
displayName: 'Run lint check'
|
||||
|
||||
- script: npm run test:validate
|
||||
displayName: 'Run TypeScript Declaration / Flow checks'
|
||||
|
||||
- bash: |
|
||||
npm install -g tap-junit
|
||||
npm run test:ava | tap-junit > test-results.xml
|
||||
env:
|
||||
CI: true
|
||||
displayName: 'Run tests'
|
||||
|
||||
- task: PublishTestResults@2
|
||||
inputs:
|
||||
testResultsFormat: JUnit
|
||||
testResultsFiles: './test-results.xml'
|
||||
testRunTitle: '$(System.JobIdentifier) tests'
|
||||
displayName: 'Publish test results'
|
||||
|
||||
- script: npm run report-coverage
|
||||
env:
|
||||
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET)
|
||||
continueOnError: true
|
||||
displayName: 'Publish coverage results'
|
||||
35
.azure-pipelines.yml
Normal file
35
.azure-pipelines.yml
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
trigger:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
- job: Linux
|
||||
pool:
|
||||
vmImage: 'ubuntu-16.04'
|
||||
strategy:
|
||||
matrix:
|
||||
Node8:
|
||||
NODE_VERSION: '8.x'
|
||||
Node10:
|
||||
NODE_VERSION: '10.x'
|
||||
steps:
|
||||
- template: .azure-pipelines-steps.yml
|
||||
|
||||
- job: Windows
|
||||
pool:
|
||||
vmImage: vs2017-win2016
|
||||
strategy:
|
||||
matrix:
|
||||
Node10:
|
||||
NODE_VERSION: '10.x'
|
||||
steps:
|
||||
- template: .azure-pipelines-steps.yml
|
||||
|
||||
- job: macOS
|
||||
pool:
|
||||
vmImage: macos-10.13
|
||||
strategy:
|
||||
matrix:
|
||||
Node10:
|
||||
NODE_VERSION: '10.x'
|
||||
steps:
|
||||
- template: .azure-pipelines-steps.yml
|
||||
3
ava.config.js
Normal file
3
ava.config.js
Normal file
|
|
@ -0,0 +1,3 @@
|
|||
export default function config() {
|
||||
return process.env.CI ? {tap: true} : {};
|
||||
}
|
||||
11
package.json
11
package.json
|
|
@ -8,8 +8,12 @@
|
|||
"node": ">=8"
|
||||
},
|
||||
"scripts": {
|
||||
"test": "xo && nyc ava && tsd-check && flow",
|
||||
"bench": "matcha benchmark.js"
|
||||
"test:lint": "xo",
|
||||
"test:ava": "nyc ava",
|
||||
"test:validate": "tsd-check && flow",
|
||||
"test": "npm-run-all test:*",
|
||||
"bench": "matcha benchmark.js",
|
||||
"report-coverage": "nyc report --reporter=text-lcov | coveralls"
|
||||
},
|
||||
"files": [
|
||||
"index.js",
|
||||
|
|
@ -53,7 +57,8 @@
|
|||
"flow-bin": "^0.94.0",
|
||||
"import-fresh": "^3.0.0",
|
||||
"matcha": "^0.7.0",
|
||||
"nyc": "^13.3.0",
|
||||
"npm-run-all": "^4.1.5",
|
||||
"nyc": "^13.1.0",
|
||||
"resolve-from": "^4.0.0",
|
||||
"tsd-check": "^0.3.0",
|
||||
"xo": "^0.24.0"
|
||||
|
|
|
|||
|
|
@ -10,6 +10,7 @@
|
|||
> Terminal string styling done right
|
||||
|
||||
[](https://travis-ci.org/chalk/chalk) [](https://coveralls.io/github/chalk/chalk?branch=master) [](https://www.npmjs.com/package/chalk?activeTab=dependents) [](https://www.npmjs.com/package/chalk) [](https://www.youtube.com/watch?v=9auOCbH5Ns4) [](https://github.com/xojs/xo) 
|
||||
[](https://dev.azure.com/chalk-ci/chalk/_build/latest?definitionId=1&branchName=master)
|
||||
|
||||
<img src="https://cdn.jsdelivr.net/gh/chalk/ansi-styles@8261697c95bf34b6c7767e2cbe9941a851d59385/screenshot.svg" width="900">
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue