ARO-RP/.pipelines/ci.yml

89 строки
1.9 KiB
YAML

# Azure DevOps Pipeline running CI
trigger:
branches:
include:
- master
paths:
exclude:
- docs/*
pr:
branches:
include:
- master
paths:
exclude:
- docs/*
variables:
- template: vars.yml
jobs:
- job: Python_Unit_Tests
pool:
name: ARO-CI
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make test-python
[[ -z "$(git status -s)" ]]
displayName: 🧪Run Python Unit Tests
- job: Golang_Unit_Tests
pool:
name: ARO-CI
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make generate
[[ -z "$(git status -s)" ]]
displayName: ⚙️ Run Golang code generate
- script: |
set -xe
make validate-go
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Validate Golang code
- script: |
set -xe
make lint-go
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Lint Golang code
- script: |
set -xe
make build-all
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Build Golang code
- script: |
set -xe
make unit-test-go
displayName: 🧪 Run Golang unit tests
- task: PublishTestResults@2
displayName: 📊 Publish tests results
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
condition: succeededOrFailed()
- script: |
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
displayName: ⚙️ Process Reports
condition: succeededOrFailed()
- task: PublishCodeCoverageResults@1
displayName: 📈 Publish code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
failIfCoverageEmpty: false
condition: succeededOrFailed()