Use Pipeline templates from futagoza/apt

master
Futago-za Ryuu 6 years ago
parent 0074d0456a
commit 41b5f44288

@ -1,68 +1,26 @@
name: $(BuildID)
pool:
vmImage: 'ubuntu-16.04'
resources:
repositories:
- repository: apt
type: github
name: futagoza/apt
variables:
- group: 'env-variables'
strategy:
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: |
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: |
./cc-test-reporter before-build
yarn ci 2> /dev/null
if [ $? -eq 0 ]
then
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:
CC_TEST_REPORTER_ID: $(CC_TEST_REPORTER_ID)
COVERALLS_SERVICE_NAME: $(COVERALLS_SERVICE_NAME)
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
GIT_BRANCH: $(Build.SourceBranch)
GIT_COMMIT_SHA: $(Build.SourceVersion)
- 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'
jobs:
- template: eslint.yml@apt
- template: node-test.yml@apt
parameters:
node_version: 6.x
after:
- script: yarn coverage
env:
COVERALLS_SERVICE_NAME: $(COVERALLS_SERVICE_NAME)
COVERALLS_REPO_TOKEN: $(COVERALLS_REPO_TOKEN)
GIT_BRANCH: $(Build.SourceBranch)
GIT_COMMIT_SHA: $(Build.SourceVersion)
azure_coverage: True

Loading…
Cancel
Save