Skip to content

Commit

Permalink
Move PR validation pipeline to yml, run as matrix (microsoft#135)
Browse files Browse the repository at this point in the history
  • Loading branch information
jakebailey authored Mar 9, 2020
1 parent 7265905 commit 8fbaed6
Show file tree
Hide file tree
Showing 6 changed files with 903 additions and 290 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -18,4 +18,4 @@ client/typeshed-fallback/

junit.xml
coverage/
combinedcoverageoutput/
coverage-merged/
13 changes: 12 additions & 1 deletion .prettierrc
Original file line number Diff line number Diff line change
Expand Up @@ -2,5 +2,16 @@
"singleQuote": true,
"tabWidth": 4,
"useTabs": false,
"printWidth": 120
"printWidth": 120,
"overrides": [
{
"files": [
"*.yml",
"*.yaml"
],
"options": {
"tabWidth": 2
}
}
]
}
57 changes: 57 additions & 0 deletions build/pr-validation.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
trigger: none

pr:
autoCancel: true
branches:
include: ['master']

strategy:
matrix:
linux:
imageName: 'ubuntu-latest'
mac:
imageName: 'macOS-latest'
windows:
imageName: 'windows-latest'

pool:
vmImage: $(imageName)

steps:
- task: NodeTool@0
displayName: Use Node 12.x
inputs:
versionSpec: '12.x'

- task: Npm@1
displayName: npm run package
inputs:
command: 'custom'
customCommand: 'run package'

- task: Npm@1
displayName: npm run test:all:pipeline
inputs:
command: 'custom'
customCommand: 'run test:all:pipeline'

- task: PublishPipelineArtifact@1
displayName: Publish Istanbul report as artifact
inputs:
targetPath: '$(System.DefaultWorkingDirectory)/server/coverage-merged'
artifact: '$(imageName)-server-coverage-merged'
publishLocation: 'pipeline'

- task: PublishTestResults@2
displayName: Publish test results
inputs:
testResultsFormat: 'JUnit'
testResultsFiles: '**/junit.xml'
testRunTitle: 'Test results for JavaScript'

- task: PublishCodeCoverageResults@1
displayName: Publish coverage results
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: '$(System.DefaultWorkingDirectory)/server/coverage-merged/cobertura-coverage.xml'
failIfCoverageEmpty: true
4 changes: 3 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,9 @@
"clean": "del-cli \"./client/server\" && del-cli \"./client/out\" && del-cli \"./dist\"",
"clean:pyright": "cd server/pyright && npm run clean && cd ../..",
"clean:all": "npm run clean && npm run clean:pyright",
"package": "npm run install:all && npm run clean:pyright && cd server && npm run build && npx webpack && cd .."
"package": "npm run install:all && npm run clean:pyright && cd server && npm run build && npx webpack && cd ..",
"test:all": "cd server && npm run test:all && cd ..",
"test:all:pipeline": "cd server && npm run test:all:pipeline && cd .."
},
"devDependencies": {
"@types/node": "^12.12.28",
Expand Down
Loading

0 comments on commit 8fbaed6

Please sign in to comment.