Use Pipeline templates from futagoza/apt
parent
0074d0456a
commit
41b5f44288
@ -1,68 +1,26 @@
|
|||||||
name: $(BuildID)
|
name: $(BuildID)
|
||||||
|
|
||||||
pool:
|
resources:
|
||||||
vmImage: 'ubuntu-16.04'
|
repositories:
|
||||||
|
- repository: apt
|
||||||
|
type: github
|
||||||
|
name: futagoza/apt
|
||||||
|
|
||||||
variables:
|
variables:
|
||||||
- group: 'env-variables'
|
- group: 'env-variables'
|
||||||
|
|
||||||
strategy:
|
jobs:
|
||||||
maxParallel: 3
|
|
||||||
matrix:
|
|
||||||
Node 6:
|
|
||||||
node_version: 6.x
|
|
||||||
Node 8:
|
|
||||||
node_version: 8.x
|
|
||||||
Node 10:
|
|
||||||
node_version: 10.x
|
|
||||||
|
|
||||||
steps:
|
|
||||||
- task: NodeTool@0
|
|
||||||
inputs:
|
|
||||||
versionSpec: $(node_version)
|
|
||||||
displayName: 'Install Node.js'
|
|
||||||
|
|
||||||
- script: |
|
- template: eslint.yml@apt
|
||||||
yarn install --ignore-engines
|
|
||||||
echo 'Downloading Code Climate Test Reporter...'
|
|
||||||
curl -L https://codeclimate.com/downloads/test-reporter/test-reporter-latest-linux-amd64 > ./cc-test-reporter
|
|
||||||
chmod +x ./cc-test-reporter
|
|
||||||
echo 'Done downloading Code Climate Test Reporter.'
|
|
||||||
displayName: 'Install dependencies'
|
|
||||||
|
|
||||||
- script: |
|
- template: node-test.yml@apt
|
||||||
./cc-test-reporter before-build
|
parameters:
|
||||||
yarn ci 2> /dev/null
|
node_version: 6.x
|
||||||
if [ $? -eq 0 ]
|
after:
|
||||||
then
|
- script: yarn coverage
|
||||||
echo '"yarn ci" passed, publishing to code climate.'
|
|
||||||
./cc-test-reporter after-build --exit-code 0
|
|
||||||
echo 'Publishing code coverage results to coveralls.io'
|
|
||||||
yarn coverage
|
|
||||||
exit 0
|
|
||||||
else
|
|
||||||
echo '"yarn ci" failed, publishing to code climate.'
|
|
||||||
./cc-test-reporter after-build --exit-code 1
|
|
||||||
exit 1
|
|
||||||
fi
|
|
||||||
displayName: 'eslint > mocha > codeclimate & coveralls'
|
|
||||||
env:
|
env:
|
||||||
CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
|
|
||||||
COVERALLS_SERVICE_NAME: $(COVERALLS_SERVICE_NAME)
|
COVERALLS_SERVICE_NAME: $(COVERALLS_SERVICE_NAME)
|
||||||
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
|
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
|
||||||
GIT_BRANCH: $(Build.SourceBranch)
|
GIT_BRANCH: $(Build.SourceBranch)
|
||||||
GIT_COMMIT_SHA: $(Build.SourceVersion)
|
GIT_COMMIT_SHA: $(Build.SourceVersion)
|
||||||
|
azure_coverage: True
|
||||||
- task: PublishTestResults@2
|
|
||||||
displayName: 'Publish test results (Azure Pipelines)'
|
|
||||||
condition: succeededOrFailed()
|
|
||||||
inputs:
|
|
||||||
testRunner: JUnit
|
|
||||||
testResultsFiles: 'test/junit-results.xml'
|
|
||||||
|
|
||||||
- task: PublishCodeCoverageResults@1
|
|
||||||
displayName: 'Publish code coverage results (Azure Pipelines)'
|
|
||||||
inputs:
|
|
||||||
codeCoverageTool: Cobertura
|
|
||||||
summaryFileLocation: '$(System.DefaultWorkingDirectory)/coverage/cobertura-coverage.xml'
|
|
||||||
reportDirectory: '$(System.DefaultWorkingDirectory)/coverage/lcov-report'
|
|
||||||
|
Loading…
Reference in New Issue