ARO-RP/.pipelines/ci.yml

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

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:
branches:
include:
- master
paths:
exclude:
- docs/*
tags:
include:
- v2*
pr:
branches:
include:
- master
paths:
exclude:
- docs/*
2020-01-25 01:39:17 +03:00
2023-01-16 04:18:27 +03:00
resources:
containers:
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.20.10
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:
- template: vars.yml
2020-01-25 01:39:17 +03:00
jobs:
Migrate RP from Azure AD Graph to Microsoft Graph (#1970) * go.mod: Add github.com/microsoftgraph/msgraph-sdk-go * azureclient: Add NewGraphServiceClient Creates a GraphServiceClient with scope and graph endpoint set appropriately for the cloud environment (public or US government). * pkg/util/graph: Add GetServicePrincipalIDByAppID * armhelper: Use MS Graph to obtain service principal ID * armhelper: Remove unused authorizer parameter * Use MS Graph endpoint to validate service principal I don't think it matters for the purpose of validation, but the AD Graph endpoint is nearing its end-of-life. * pkg/cluster: Use MS Graph to obtain service principal ID * pkg/util/cluster: Use MS Graph to create and delete clusters * Pretty-print OData errors from MS Graph To aid debugging failed MS Graph requests. MS Graph's top-level APIError message is hard-coded and only says "error status code received from the API". Further details have to be extracted from the "ODataErrorable" interface type. * azureclient: Remove ActiveDirectoryGraphScope No longer used. * Remove pkg/util/azureclient/graphrbac No longer used. * pipelines: Run CodeQL analysis for Go on 1ES Hosted Pool Vendoring the Microsoft Graph SDK for Go causes memory consumption during CodeQL analysis to double due to its enormous API surface, putting it well beyond the memory limit of standard GitHub Action runners. I inquired with the Azure organization admins about provisioning larger GitHub runners, but was directed instead to use the 1ES Hosted Pool which runs our other CI checks. Since ARO controls the VM type for Hosted Pool agents, we can use a VM type with adequate memory for CodeQL analysis with the Graph SDK. Note: Implemented CodeQL commands in a template in case we ever decide to move Javascript or Python analysis to 1ES Hosted Pool as well.
2023-06-14 20:10:37 +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
- job: Golang_Unit_Tests
pool:
name: 1es-aro-ci-pool
variables:
GOCACHE: /tmp/gocache
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
go version
go env
displayName: Print Go version & env
target: golang
2023-01-16 04:18:27 +03:00
- script: |
set -xe
make generate
[[ -z "$(git status -s)" ]]
displayName: ⚙️ Run Golang code generate
target: golang
- script: |
set -xe
make build-all
[[ -z "$(git status -s)" ]]
displayName: 🕵️ Build Golang code
target: golang
- script: |
set -xe
make unit-test-go
displayName: 🧪 Run Golang unit tests
target: golang
- task: PublishTestResults@2
displayName: 📊 Publish tests results
inputs:
testResultsFiles: $(System.DefaultWorkingDirectory)/**/report.xml
condition: succeededOrFailed()
2020-01-25 01:39:17 +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
- task: PublishCodeCoverageResults@1
displayName: 📈 Publish code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
failIfCoverageEmpty: false
condition: succeededOrFailed()
target: golang
- 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