ARO-RP/.pipelines/ci.yml

70 строки
2.3 KiB
YAML
Исходник Обычный вид История

2020-01-25 01:39:17 +03:00
# Azure DevOps Pipeline running CI
trigger:
- master
variables:
- template: vars.yml
jobs:
- job: "Python_Unit_Tests"
pool:
vmImage: "ubuntu-latest"
strategy:
matrix:
Python27:
python.version: "2.7"
2020-01-25 01:39:17 +03:00
Python35:
python.version: "3.5"
2020-01-25 01:39:17 +03:00
steps:
- task: UsePythonVersion@0
inputs:
versionSpec: "$(python.version)"
- template: ./templates/template-setup-golang-env.yml
parameters:
gobin: ${{ variables.GOBIN }}
gopath: ${{ variables.GOPATH }}
goroot: ${{ variables.GOROOT }}
modulePath: ${{ variables.modulePath }}
- script: |
set -x
2020-01-30 20:59:31 +03:00
sudo ln -s $USEPYTHONVERSION_PYTHONLOCATION/bin/python$(python.version) /usr/bin/python$(python.version)
2020-01-25 01:39:17 +03:00
pip install virtualenv
make test-python
displayName: "🧪Run Python Unit Tests : $(python.version)"
workingDirectory: "${{ variables.modulePath }}"
- job: "Golang_Unit_Tests"
pool:
vmImage: "ubuntu-latest"
steps:
- template: ./templates/template-setup-golang-env.yml
parameters:
gobin: ${{ variables.GOBIN }}
gopath: ${{ variables.GOPATH }}
goroot: ${{ variables.GOROOT }}
modulePath: ${{ variables.modulePath }}
- script: |
set -x
make test-go
[[ -z "$(git status -s)" ]]
go run ./vendor/github.com/jstemmer/go-junit-report/go-junit-report.go < uts.txt > report.xml
go run ./vendor/github.com/axw/gocov/gocov/*.go convert cover.out > coverage.json
go run ./vendor/github.com/AlekSi/gocov-xml/gocov-xml.go < coverage.json > coverage.xml
2020-01-25 01:39:17 +03:00
workingDirectory: "${{ variables.modulePath }}"
displayName: "🧪Run Golang Unit Tests"
- task: PublishTestResults@2
displayName: "📊 Publish tests results"
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
displayName: "📈 Publish code coverage"
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: "$(System.DefaultWorkingDirectory)/**/coverage.xml"
failIfCoverageEmpty: false
condition: succeededOrFailed()