From 308987e615cab6a5c3297c5bf25ebc8e20507f50 Mon Sep 17 00:00:00 2001 From: Vishnu Sankar Date: Mon, 3 Aug 2020 01:21:29 +0530 Subject: [PATCH] - Added azure pipeline --- azure-pipeline/npm.yml | 48 +++++++++++++++++++++++++++++++++ azure-pipeline/pull-request.yml | 34 +++++++++++++++++++++++ 2 files changed, 82 insertions(+) create mode 100644 azure-pipeline/npm.yml create mode 100644 azure-pipeline/pull-request.yml diff --git a/azure-pipeline/npm.yml b/azure-pipeline/npm.yml new file mode 100644 index 00000000..07116eb3 --- /dev/null +++ b/azure-pipeline/npm.yml @@ -0,0 +1,48 @@ +name: 1.0$(rev:.r) +trigger: + branches: + include: + - master +pr: none + +pool: + name: Hosted Ubuntu 1604 + demands: npm + +steps: + # Authenticate + - task: npmAuthenticate@0 + displayName: NPM Auth + inputs: + workingFile: .npmrc + customEndpoint: 'Vishnu Sankar' + + # Build & Test + - bash: | + yarn install + yarn build:tsc + yarn build:ywc + yarn test + yarn set-version + displayName: Build & Test + + # Test Result + - task: PublishTestResults@2 + displayName: Publish Test Result + inputs: + testResultsFormat: 'JUnit' + testResultsFiles: 'junit.xml' + failTaskOnFailedTests: true + + # Coverage Result + - task: PublishCodeCoverageResults@1 + displayName: Publish Coverage Result + inputs: + codeCoverageTool: 'Cobertura' + summaryFileLocation: 'coverage/cobertura-coverage.xml' + failIfCoverageEmpty: true + + # Publish Packages + - bash: | + yarn ywc publish + displayName: Publish Packages diff --git a/azure-pipeline/pull-request.yml b/azure-pipeline/pull-request.yml new file mode 100644 index 00000000..8af3ae59 --- /dev/null +++ b/azure-pipeline/pull-request.yml @@ -0,0 +1,34 @@ +name: 1.0$(rev:.r) +trigger: none +pr: + branches: + include: + - master + +pool: + name: Hosted Ubuntu 1604 + +steps: + # Install, Build & Test + - bash: | + yarn install + yarn build:tsc + yarn test + yarn set-version + displayName: Install, Build & Test + + # Publish Test Results + - task: PublishTestResults@2 + displayName: 'Publish Test Results junit.xml' + inputs: + testResultsFiles: junit.xml + failTaskOnFailedTests: true + + # Publish code coverage + - task: PublishCodeCoverageResults@1 + displayName: 'Publish code coverage from $(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml' + inputs: + codeCoverageTool: Cobertura + summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml' + reportDirectory: '$(System.DefaultWorkingDirectory)/coverage' + failIfCoverageEmpty: true