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

Explicitly run coveralls step #2306

Closed
wants to merge 3 commits into from
Closed
Show file tree
Hide file tree
Changes from 2 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
30 changes: 30 additions & 0 deletions .ci/.azure-pipelines-steps.yml
Original file line number Diff line number Diff line change
@@ -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 cover && istanbul-coveralls
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@damccorm With this change, couldn't they change the npm run cover command and have access?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes 🤦‍♂️ Updated appropriately, sorry about that

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()
72 changes: 72 additions & 0 deletions .ci/.azure-pipelines.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -29,3 +29,6 @@ node_modules

# Garbage files
.DS_Store

# Test results
xunit.xml
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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"
},
Expand Down