2020-01-25 01:39:17 +03:00
|
|
|
# Azure DevOps Pipeline running CI
|
2023-08-17 00:13:48 +03:00
|
|
|
|
2020-01-25 01:39:17 +03:00
|
|
|
trigger:
|
2021-04-27 11:40:34 +03:00
|
|
|
branches:
|
|
|
|
include:
|
2023-08-01 14:41:31 +03:00
|
|
|
- master
|
2021-04-27 11:40:34 +03:00
|
|
|
paths:
|
|
|
|
exclude:
|
2023-08-01 14:41:31 +03:00
|
|
|
- docs/*
|
2021-08-17 15:13:29 +03:00
|
|
|
tags:
|
|
|
|
include:
|
2023-08-01 14:41:31 +03:00
|
|
|
- v2*
|
2021-04-27 11:40:34 +03:00
|
|
|
|
|
|
|
pr:
|
|
|
|
branches:
|
|
|
|
include:
|
2023-08-01 14:41:31 +03:00
|
|
|
- master
|
2021-04-27 11:40:34 +03:00
|
|
|
paths:
|
|
|
|
exclude:
|
2023-08-01 14:41:31 +03:00
|
|
|
- docs/*
|
2020-01-25 01:39:17 +03:00
|
|
|
|
2023-01-16 04:18:27 +03:00
|
|
|
resources:
|
|
|
|
containers:
|
2023-08-01 14:41:31 +03:00
|
|
|
- container: golang
|
2024-04-29 10:47:35 +03:00
|
|
|
image: registry.access.redhat.com/ubi8/go-toolset:1.20.12-5
|
2023-08-01 14:41:31 +03:00
|
|
|
options: --user=0
|
|
|
|
- container: python
|
|
|
|
image: registry.access.redhat.com/ubi8/python-39:latest
|
|
|
|
options: --user=0
|
2023-01-16 04:18:27 +03:00
|
|
|
|
2020-01-25 01:39:17 +03:00
|
|
|
variables:
|
2023-08-01 14:41:31 +03:00
|
|
|
- template: vars.yml
|
2020-01-25 01:39:17 +03:00
|
|
|
|
|
|
|
jobs:
|
2023-06-14 20:10:37 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- job: Python_Unit_Tests
|
|
|
|
pool:
|
|
|
|
name: 1es-aro-ci-pool
|
|
|
|
variables:
|
|
|
|
HOME: $(Agent.BuildDirectory)
|
|
|
|
steps:
|
|
|
|
- template: ./templates/template-checkout.yml
|
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
make test-python
|
|
|
|
[[ -z "$(git status -s)" ]]
|
|
|
|
displayName: 🧪Run Python Unit Tests
|
|
|
|
target: python
|
2020-01-25 01:39:17 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- job: Golang_Unit_Tests
|
|
|
|
pool:
|
|
|
|
name: 1es-aro-ci-pool
|
|
|
|
variables:
|
|
|
|
GOCACHE: /tmp/gocache
|
|
|
|
steps:
|
|
|
|
- template: ./templates/template-checkout.yml
|
2021-04-27 11:40:34 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
go version
|
|
|
|
go env
|
|
|
|
displayName: Print Go version & env
|
|
|
|
target: golang
|
2023-01-16 04:18:27 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
make generate
|
|
|
|
[[ -z "$(git status -s)" ]]
|
|
|
|
displayName: ⚙️ Run Golang code generate
|
|
|
|
target: golang
|
2020-02-12 13:43:45 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
make build-all
|
|
|
|
[[ -z "$(git status -s)" ]]
|
|
|
|
displayName: 🕵️ Build Golang code
|
|
|
|
target: golang
|
2021-04-27 11:40:34 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
make unit-test-go
|
|
|
|
displayName: 🧪 Run Golang unit tests
|
|
|
|
target: golang
|
2020-02-12 13:43:45 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- task: PublishTestResults@2
|
|
|
|
displayName: 📊 Publish tests results
|
|
|
|
inputs:
|
|
|
|
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
|
|
|
|
condition: succeededOrFailed()
|
2020-01-25 01:39:17 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
go run github.com/axw/gocov/gocov@v1.1.0 convert cover.out | go run github.com/AlekSi/gocov-xml@v1.1.0 > coverage.xml
|
|
|
|
displayName: ⚙️ Process Reports
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
target: golang
|
2021-04-27 11:40:34 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- task: PublishCodeCoverageResults@1
|
|
|
|
displayName: 📈 Publish code coverage
|
|
|
|
inputs:
|
|
|
|
codeCoverageTool: Cobertura
|
|
|
|
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
|
|
|
|
failIfCoverageEmpty: false
|
|
|
|
condition: succeededOrFailed()
|
|
|
|
target: golang
|
2021-03-19 13:39:27 +03:00
|
|
|
|
2023-08-01 14:41:31 +03:00
|
|
|
- job: Lint_Admin_Portal
|
|
|
|
pool:
|
|
|
|
name: 1es-aro-ci-pool
|
|
|
|
steps:
|
|
|
|
- template: ./templates/template-checkout.yml
|
|
|
|
- script: |
|
|
|
|
set -xe
|
|
|
|
make lint-admin-portal
|
|
|
|
displayName: 🧹 Lint Admin Portal
|