Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Set up CI with Azure Pipelines #29

Open
wants to merge 10 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,4 @@ web.gif
website/
.nyc_output/
coverage/
results/
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,9 @@

## *Easily generate animated GIFs from websites*

[![Build Status](https://travis-ci.org/anishkny/webgif.svg?branch=master)](https://travis-ci.org/anishkny/webgif)
[![Build status](https://ci.appveyor.com/api/projects/status/ji5c66ex9ifog9hk/branch/master?svg=true)](https://ci.appveyor.com/project/anishkny/webgif/branch/master)
[![Build Status](https://dev.azure.com/anishkarandikar/webgif/_apis/build/status/anishkny.webgif)](https://dev.azure.com/anishkarandikar/webgif/_build/latest?definitionId=2)
[![Greenkeeper badge](https://badges.greenkeeper.io/anishkny/webgif.svg)](https://greenkeeper.io/)
[![Coverage Status](https://coveralls.io/repos/github/anishkny/webgif/badge.svg)](https://coveralls.io/github/anishkny/webgif)
[![Coverage Status](https://img.shields.io/azure-devops/coverage/anishkarandikar/webgif/2/master.svg)](https://dev.azure.com/anishkarandikar/webgif/_build?definitionId=2)
![node](https://img.shields.io/node/v/webgif.svg)
[![NPM Version](https://img.shields.io/npm/v/webgif.svg)](https://www.npmjs.com/package/webgif)

Expand Down
42 changes: 42 additions & 0 deletions azure-pipelines-template.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
jobs:
- job: ${{ parameters.name }}

pool:
vmImage: ${{ parameters.vmImage }}

strategy:
matrix:
Node8:
node_version: 8.x
Node10:
node_version: 10.x
Node11:
node_version: 11.x

steps:
- task: NodeTool@0
inputs:
versionSpec: $(node_version)
displayName: 'Install Node.js'

- task: Npm@1
displayName: 'Install dependencies'
inputs:
command: install

- task: Npm@1
displayName: 'Run tests'
inputs:
command: custom
customCommand: 'test'

- task: PublishTestResults@2
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: 'results/mocha-test-results.xml'

- task: PublishCodeCoverageResults@1
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage'
15 changes: 15 additions & 0 deletions azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
jobs:
- template: azure-pipelines-template.yml
parameters:
name: macOS
vmImage: macOS-10.13

- template: azure-pipelines-template.yml
parameters:
name: Linux
vmImage: ubuntu-16.04

- template: azure-pipelines-template.yml
parameters:
name: Windows
vmImage: vs2017-win2016
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
"webgif": "./index.js"
},
"scripts": {
"test": "nyc -r text -r html -r lcov mocha",
"test": "nyc -r text -r html -r lcov -r cobertura mocha",
"website": "mkdir -p website; (cat header.html; showdown makehtml -m -i README.md) > website/index.html"
},
"engines": {
Expand Down Expand Up @@ -37,6 +37,8 @@
},
"devDependencies": {
"mocha": "^5.2.0",
"mocha-junit-reporter": "^1.18.0",
"mocha-multi-reporters": "^1.1.7",
"nyc": "^12.0.1",
"shelljs": "^0.8.1",
"showdown": "^1.8.6"
Expand Down
6 changes: 6 additions & 0 deletions test/mocha-multi-reporter.config.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"reporterEnabled": "spec, mocha-junit-reporter",
"mochaJunitReporterReporterOptions": {
"mochaFile": "results/mocha-test-results.xml"
}
}
2 changes: 2 additions & 0 deletions test/mocha.opts
Original file line number Diff line number Diff line change
@@ -1 +1,3 @@
--timeout 120000
--reporter mocha-multi-reporters
--reporter-options configFile=test/mocha-multi-reporter.config.json