Skip to content

Commit

Permalink
Build: Add Azure Pipelines CI (#2299)
Browse files Browse the repository at this point in the history
  • Loading branch information
Danny McCormick authored and phated committed Mar 24, 2019
1 parent ed27cbe commit b2c6c7e
Show file tree
Hide file tree
Showing 4 changed files with 131 additions and 5 deletions.
38 changes: 38 additions & 0 deletions .ci/.azure-pipelines-steps.yml
@@ -0,0 +1,38 @@
steps:
- script: npm i -g npm@$(npm_version)
displayName: Use legacy npm version $(npm_version)
condition: ne(variables['npm_version'], '')

- task: NodeTool@0
inputs:
versionSpec: '$(node_version)'
displayName: Use Node $(node_version)

- script: npm install
displayName: npm install

- script: npm test
displayName: Run tests

- script: npm run coveralls
displayName: Run coveralls
env:
# Pretend to be AppVeyor for now
APPVEYOR: true
APPVEYOR_BUILD_NUMBER: $(Build.BuildNumber)
APPVEYOR_BUILD_ID: $(Agent.OS)_$(node_version)
APPVEYOR_REPO_COMMIT: $(Build.SourceVersion)
APPVEYOR_REPO_BRANCH: $(Build.SourceBranchName)
# Overwrite the GitLab Service Name
COVERALLS_SERVICE_NAME: Azure Pipelines
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET)
COVERALLS_PARALLEL: true
CI_PULL_REQUEST: $(System.PullRequest.PullRequestNumber)

- script: npm run azure-pipelines
displayName: Write tests to xml

- task: PublishTestResults@2
inputs:
testResultsFiles: '**/test.xunit'
condition: succeededOrFailed()
84 changes: 84 additions & 0 deletions .ci/.azure-pipelines.yml
@@ -0,0 +1,84 @@
trigger:
- master
- releases/*

jobs:
- job: Test_Linux
displayName: Run Tests on Linux
pool:
vmImage: "Ubuntu 16.04"
strategy:
matrix:
Node_v10:
node_version: 10
Node_v8:
node_version: 8
Node_v6:
node_version: 6
Node_v4:
node_version: 4
Node_v0_12:
node_version: 0.12
Node_v0_10:
node_version: 0.10
steps:
- template: .azure-pipelines-steps.yml

- job: Test_Windows
displayName: Run Tests on Windows
pool:
vmImage: vs2017-win2016
strategy:
matrix:
Node_v10:
node_version: 10
Node_v8:
node_version: 8
Node_v6:
node_version: 6
Node_v4:
node_version: 4
npm_version: 2
Node_v0_12:
node_version: 0.12
npm_version: 2
Node_v0_10:
node_version: 0.10
npm_version: 2
steps:
- template: .azure-pipelines-steps.yml

- job: Test_MacOS
displayName: Run Tests on MacOS
pool:
vmImage: macos-10.13
strategy:
matrix:
Node_v10:
node_version: 10
Node_v8:
node_version: 8
Node_v6:
node_version: 6
Node_v4:
node_version: 4
Node_v0_12:
node_version: 0.12
Node_v0_10:
node_version: 0.10
steps:
- template: .azure-pipelines-steps.yml

- job: Notify_Coveralls
displayName: Notify Coveralls that the parallel report is done
pool:
vmImage: "Ubuntu 16.04"
dependsOn:
- Test_Linux
- Test_Windows
- Test_MacOS
steps:
- script: curl -k https://coveralls.io/webhook?repo_token=$COVERALLS_REPO_TOKEN -d "payload[build_num]=$BUILD_NAME&payload[status]=done"
env:
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET)
BUILD_NAME: $(Build.BuildNumber)
4 changes: 4 additions & 0 deletions .gitignore
Expand Up @@ -12,6 +12,7 @@ lib-cov

# Coverage directory used by tools like istanbul
coverage
.nyc_output

# Grunt intermediate storage (https://gruntjs.com/creating-plugins#storing-task-files)
.grunt
Expand All @@ -29,3 +30,6 @@ node_modules

# Garbage files
.DS_Store

# Test results
test.xunit
10 changes: 5 additions & 5 deletions package.json
Expand Up @@ -25,9 +25,9 @@
"scripts": {
"lint": "eslint .",
"pretest": "npm run lint",
"test": "mocha --async-only",
"cover": "istanbul cover _mocha --report lcovonly",
"coveralls": "npm run cover && istanbul-coveralls"
"test": "nyc mocha --async-only",
"azure-pipelines": "nyc mocha --async-only --reporter xunit -O output=test.xunit",
"coveralls": "nyc report --reporter=text-lcov | coveralls"
},
"dependencies": {
"glob-watcher": "^5.0.0",
Expand All @@ -36,13 +36,13 @@
"vinyl-fs": "^3.0.0"
},
"devDependencies": {
"coveralls": "github:phated/node-coveralls#2.x",
"eslint": "^2.13.1",
"eslint-config-gulp": "^3.0.1",
"expect": "^1.20.2",
"istanbul": "^0.4.3",
"istanbul-coveralls": "^1.0.3",
"mkdirp": "^0.5.1",
"mocha": "^3.0.0",
"nyc": "^10.3.2",
"rimraf": "^2.2.5"
},
"keywords": [
Expand Down

0 comments on commit b2c6c7e

Please sign in to comment.