From 2e46ccde4dbaa2f5b270996b9767896290932be8 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 20 Mar 2019 15:06:50 -0400 Subject: [PATCH 1/3] Build: Add Azure Pipelines CI (#2299) --- .ci/.azure-pipelines-steps.yml | 30 ++++++++++++++ .ci/.azure-pipelines.yml | 72 ++++++++++++++++++++++++++++++++++ .gitignore | 3 ++ package.json | 1 + 4 files changed, 106 insertions(+) create mode 100644 .ci/.azure-pipelines-steps.yml create mode 100644 .ci/.azure-pipelines.yml diff --git a/.ci/.azure-pipelines-steps.yml b/.ci/.azure-pipelines-steps.yml new file mode 100644 index 000000000..9fba2758a --- /dev/null +++ b/.ci/.azure-pipelines-steps.yml @@ -0,0 +1,30 @@ +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 run coveralls + env: + COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) + displayName: Run coveralls + condition: eq(variables['run_coveralls'], true) + +- script: npm test + displayName: Run tests + condition: ne(variables['run_coveralls'], true) + +- script: npm run azure-pipelines + displayName: Write tests to xml + +- task: PublishTestResults@2 + inputs: + testResultsFiles: '**/test.xunit' + condition: succeededOrFailed() diff --git a/.ci/.azure-pipelines.yml b/.ci/.azure-pipelines.yml new file mode 100644 index 000000000..28700a22c --- /dev/null +++ b/.ci/.azure-pipelines.yml @@ -0,0 +1,72 @@ +trigger: +- master +- releases/* + +jobs: + - job: Test_Linux + displayName: Run Tests on Linux + pool: + vmImage: "Ubuntu 16.04" + variables: + run_coveralls: true + 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 diff --git a/.gitignore b/.gitignore index ac88dd1f0..cd1236f5f 100644 --- a/.gitignore +++ b/.gitignore @@ -29,3 +29,6 @@ node_modules # Garbage files .DS_Store + +# Test results +xunit.xml diff --git a/package.json b/package.json index a4ce8bcaa..331ca3b33 100644 --- a/package.json +++ b/package.json @@ -26,6 +26,7 @@ "lint": "eslint .", "pretest": "npm run lint", "test": "mocha --async-only", + "azure-pipelines": "mocha --async-only --reporter xunit -O output=test.xunit", "cover": "istanbul cover _mocha --report lcovonly", "coveralls": "npm run cover && istanbul-coveralls" }, From 5a67cde48c66115d86c4fd49ecd46b1d680a4ac9 Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 20 Mar 2019 15:54:23 -0400 Subject: [PATCH 2/3] Explicitly run coveralls step --- .ci/.azure-pipelines-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/.azure-pipelines-steps.yml b/.ci/.azure-pipelines-steps.yml index 9fba2758a..c3ba8c18f 100644 --- a/.ci/.azure-pipelines-steps.yml +++ b/.ci/.azure-pipelines-steps.yml @@ -11,7 +11,7 @@ steps: - script: npm install displayName: npm install -- script: npm run coveralls +- script: npm run cover && istanbul-coveralls env: COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) displayName: Run coveralls From ebfd4eef45e044a4219dfe9f8218075d53c8e7eb Mon Sep 17 00:00:00 2001 From: Danny McCormick Date: Wed, 20 Mar 2019 18:05:10 -0400 Subject: [PATCH 3/3] Fix lingering issue --- .ci/.azure-pipelines-steps.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.ci/.azure-pipelines-steps.yml b/.ci/.azure-pipelines-steps.yml index c3ba8c18f..2f9ac9080 100644 --- a/.ci/.azure-pipelines-steps.yml +++ b/.ci/.azure-pipelines-steps.yml @@ -11,7 +11,7 @@ steps: - script: npm install displayName: npm install -- script: npm run cover && istanbul-coveralls +- script: istanbul cover _mocha --report lcovonly && istanbul-coveralls env: COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN_SECRET) displayName: Run coveralls