From 1250503523804aceb91300c2e6f145519679cddb Mon Sep 17 00:00:00 2001 From: "azure-pipelines[bot]" Date: Sun, 18 Nov 2018 18:16:57 +0000 Subject: [PATCH 01/10] Set up CI with Azure Pipelines --- azure-pipelines.yml | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 azure-pipelines.yml diff --git a/azure-pipelines.yml b/azure-pipelines.yml new file mode 100644 index 0000000..2abd3cd --- /dev/null +++ b/azure-pipelines.yml @@ -0,0 +1,18 @@ +# Node.js with React +# Build a Node.js project that uses React. +# Add steps that analyze code, save build artifacts, deploy, and more: +# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript + +pool: + vmImage: 'Ubuntu 16.04' + +steps: +- task: NodeTool@0 + inputs: + versionSpec: '8.x' + displayName: 'Install Node.js' + +- script: | + npm install + npm test + displayName: 'npm install and test' From f66d4cbe622110a2c3b0527faf40fa605a3faa61 Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 13:30:58 -0500 Subject: [PATCH 02/10] chore(ci): Run on multiple Node.js versions --- azure-pipelines.yml | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 2abd3cd..3189b93 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -6,13 +6,28 @@ pool: vmImage: 'Ubuntu 16.04' +strategy: + matrix: + node_8_x: + node_version: 8.x + node_10_x: + node_version: 10.x + node_11_x: + node_version: 11.x + steps: - task: NodeTool@0 inputs: - versionSpec: '8.x' + versionSpec: $(node_version) displayName: 'Install Node.js' -- script: | - npm install - npm test - displayName: 'npm install and test' +- task: Npm@1 + displayName: 'Install dependencies' + inputs: + command: install + +- task: Npm@1 + displayName: 'Run tests' + inputs: + command: custom + customCommand: 'test' From c880158503e5e38f50e1483c55840dc11c80e34e Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 13:35:43 -0500 Subject: [PATCH 03/10] chore(ci): Add MacOS, Window --- azure-pipelines.yml | 27 ++++++++++++++++++++++----- 1 file changed, 22 insertions(+), 5 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3189b93..a7d0963 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -3,16 +3,33 @@ # Add steps that analyze code, save build artifacts, deploy, and more: # https://docs.microsoft.com/azure/devops/pipelines/languages/javascript -pool: - vmImage: 'Ubuntu 16.04' +# pool: +# vmImage: 'Ubuntu 16.04' + +jobs: +- job: Linux + pool: + vmImage: 'ubuntu-16.04' + steps: + - script: echo hello from Linux +- job: macOS + pool: + vmImage: 'macOS-10.13' + steps: + - script: echo hello from macOS +- job: Windows + pool: + vmImage: 'vs2017-win2016' + steps: + - script: echo hello from Windows strategy: matrix: - node_8_x: + Node8: node_version: 8.x - node_10_x: + Node10: node_version: 10.x - node_11_x: + Node11: node_version: 11.x steps: From 2c1d797b32b17af06d18685e3f00f912da365bac Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 13:38:32 -0500 Subject: [PATCH 04/10] chore(ci): Add macOS, Windows --- azure-pipelines.yml | 37 ++++++++++++------------------------- 1 file changed, 12 insertions(+), 25 deletions(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index a7d0963..3bbec71 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,36 +1,23 @@ -# Node.js with React -# Build a Node.js project that uses React. -# Add steps that analyze code, save build artifacts, deploy, and more: -# https://docs.microsoft.com/azure/devops/pipelines/languages/javascript - -# pool: -# vmImage: 'Ubuntu 16.04' - -jobs: -- job: Linux - pool: - vmImage: 'ubuntu-16.04' - steps: - - script: echo hello from Linux -- job: macOS - pool: - vmImage: 'macOS-10.13' - steps: - - script: echo hello from macOS -- job: Windows - pool: - vmImage: 'vs2017-win2016' - steps: - - script: echo hello from Windows - strategy: matrix: Node8: node_version: 8.x + vm_image: 'Ubuntu 16.04' Node10: node_version: 10.x + vm_image: 'Ubuntu 16.04' + Node10_Mac: + node_version: 10.x + vm_image: 'macOS-10.13' + Node10_Win: + node_version: 10.x + vm_image: 'vs2017-win2016' Node11: node_version: 11.x + vm_image: 'Ubuntu 16.04' + +pool: + vmImage: $(vm_image) steps: - task: NodeTool@0 From 279a259eb12b57cd683dfede670296f90bf51cd4 Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 13:44:04 -0500 Subject: [PATCH 05/10] Update azure-pipelines.yml --- azure-pipelines.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 3bbec71..170ed08 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -17,7 +17,7 @@ strategy: vm_image: 'Ubuntu 16.04' pool: - vmImage: $(vm_image) + vmImage: ${{ vm_image }} steps: - task: NodeTool@0 From 6730063acbba8a60d7a873e954d3cca1d524e21f Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 14:07:09 -0500 Subject: [PATCH 06/10] chore(ci): Templatize steps --- azure-pipelines-template.yml | 31 +++++++++++++++++++++ azure-pipelines.yml | 52 +++++++++++------------------------- 2 files changed, 46 insertions(+), 37 deletions(-) create mode 100644 azure-pipelines-template.yml diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml new file mode 100644 index 0000000..ada476d --- /dev/null +++ b/azure-pipelines-template.yml @@ -0,0 +1,31 @@ +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' diff --git a/azure-pipelines.yml b/azure-pipelines.yml index 170ed08..5666af5 100644 --- a/azure-pipelines.yml +++ b/azure-pipelines.yml @@ -1,37 +1,15 @@ -strategy: - matrix: - Node8: - node_version: 8.x - vm_image: 'Ubuntu 16.04' - Node10: - node_version: 10.x - vm_image: 'Ubuntu 16.04' - Node10_Mac: - node_version: 10.x - vm_image: 'macOS-10.13' - Node10_Win: - node_version: 10.x - vm_image: 'vs2017-win2016' - Node11: - node_version: 11.x - vm_image: 'Ubuntu 16.04' - -pool: - vmImage: ${{ vm_image }} - -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' +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 From c76ad52f1d1a3f67a84fa3ee5db6b410bc39e9df Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 17:22:24 -0500 Subject: [PATCH 07/10] chore(ci): Publish test results --- .gitignore | 1 + azure-pipelines-template.yml | 5 +++++ package.json | 2 ++ test/mocha-multi-reporter.config.json | 6 ++++++ test/mocha.opts | 2 ++ 5 files changed, 16 insertions(+) create mode 100644 test/mocha-multi-reporter.config.json diff --git a/.gitignore b/.gitignore index 5005f22..724a8fc 100644 --- a/.gitignore +++ b/.gitignore @@ -5,3 +5,4 @@ web.gif website/ .nyc_output/ coverage/ +results/ diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml index ada476d..45a7a6c 100644 --- a/azure-pipelines-template.yml +++ b/azure-pipelines-template.yml @@ -29,3 +29,8 @@ jobs: inputs: command: custom customCommand: 'test' + + - task: PublishTestResults@2 + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: 'results/mocha-test-results.xml' diff --git a/package.json b/package.json index 6443128..6e4db73 100644 --- a/package.json +++ b/package.json @@ -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" diff --git a/test/mocha-multi-reporter.config.json b/test/mocha-multi-reporter.config.json new file mode 100644 index 0000000..5e5e316 --- /dev/null +++ b/test/mocha-multi-reporter.config.json @@ -0,0 +1,6 @@ +{ + "reporterEnabled": "spec, mocha-junit-reporter", + "mochaJunitReporterReporterOptions": { + "mochaFile": "results/mocha-test-results.xml" + } +} diff --git a/test/mocha.opts b/test/mocha.opts index 4effd05..0bab2ab 100644 --- a/test/mocha.opts +++ b/test/mocha.opts @@ -1 +1,3 @@ --timeout 120000 +--reporter mocha-multi-reporters +--reporter-options configFile=test/mocha-multi-reporter.config.json From d6923773848f6302f5b0c26b83022c36539b072d Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 17:39:06 -0500 Subject: [PATCH 08/10] chore(ci): Publish code coverage results --- azure-pipelines-template.yml | 6 ++++++ package.json | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml index 45a7a6c..849f8ee 100644 --- a/azure-pipelines-template.yml +++ b/azure-pipelines-template.yml @@ -34,3 +34,9 @@ jobs: inputs: testResultsFormat: 'JUnit' testResultsFiles: 'results/mocha-test-results.xml' + + - task: PublishCodeCoverageResults@1 + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: 'coverage/cobertura-coverage.xml' + reportDirectory: 'coverage' diff --git a/package.json b/package.json index 6e4db73..e463340 100644 --- a/package.json +++ b/package.json @@ -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": { From 777529d448f770a060b7d4f83826b744f303b833 Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Sun, 18 Nov 2018 17:43:26 -0500 Subject: [PATCH 09/10] chore(ci): Use absolute location for cov report --- azure-pipelines-template.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/azure-pipelines-template.yml b/azure-pipelines-template.yml index 849f8ee..389da09 100644 --- a/azure-pipelines-template.yml +++ b/azure-pipelines-template.yml @@ -38,5 +38,5 @@ jobs: - task: PublishCodeCoverageResults@1 inputs: codeCoverageTool: Cobertura - summaryFileLocation: 'coverage/cobertura-coverage.xml' - reportDirectory: 'coverage' + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/coverage' From d427a5bdb98804425750434b21a4fc1600596a32 Mon Sep 17 00:00:00 2001 From: Anish Karandikar Date: Mon, 19 Nov 2018 16:28:25 -0500 Subject: [PATCH 10/10] docs(README): Add Azure DevOps build status badge --- README.md | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/README.md b/README.md index 5de2bfa..6e1d0ca 100644 --- a/README.md +++ b/README.md @@ -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)