Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

This is the new CI-RP stage for the pipline #3753

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
133 changes: 48 additions & 85 deletions .pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,97 +20,60 @@ pr:
exclude:
- docs/*

variables:
- template: vars.yml

resources:
containers:
- container: golang
image: registry.access.redhat.com/ubi8/go-toolset:1.21.11-1.1720406008
options: --user=0
- container: python
image: registry.access.redhat.com/ubi8/python-39:latest
options: --user=0

variables:
- template: vars.yml

jobs:
- 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

- 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

- 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()
stages:
- stage: NEW_HOTNESS
jobs:
- job: Build_Lint_Test_RP_And_Portal
pool:
name: 1es-aro-ci-pool
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
export NO_CACHE=true
make ci-rp

- script: |
set -xe
go run github.com/axw/gocov/[email protected] convert cover.out | go run github.com/AlekSi/[email protected] > coverage.xml
displayName: ⚙️ Process Reports
condition: succeededOrFailed()
target: golang
- job: Build_and_Test_Az_ARO_Extension
pool:
name: 1es-aro-ci-pool
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
export NO_CACHE=true
make azext-aro

- task: PublishCodeCoverageResults@1
displayName: 📈 Publish code coverage
inputs:
codeCoverageTool: Cobertura
summaryFileLocation: $(System.DefaultWorkingDirectory)/**/coverage.xml
failIfCoverageEmpty: false
condition: succeededOrFailed()
target: golang
- job: Lint_Az_ARO_Extension
pool:
name: 1es-aro-ci-pool
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make test-python

- 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
- stage: Golang_Code_Generation
jobs:
- job: Run_Golang_Code_Generate
displayName: "⚙️ Run Golang code generate"
pool:
name: 1es-aro-ci-pool
container: golang
variables:
GOCACHE: /tmp/gocache # Set the Go build cache to a writable directory
steps:
- template: ./templates/template-checkout.yml
- script: |
set -xe
make generate
[[ -z "$(git status -s)" ]]
displayName: "Run Golang Code Generate"
7 changes: 4 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,10 @@ client: generate

.PHONY: ci-rp
ci-rp: fix-macos-vendor
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --target portal-build --no-cache=$(NO_CACHE) -t $(ARO_PORTAL_BUILD_IMAGE)
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --target builder --cache-from $(ARO_PORTAL_BUILD_IMAGE) -t $(ARO_BUILDER_IMAGE)
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --cache-from $(ARO_BUILDER_IMAGE) -t $(RP_IMAGE_LOCAL)
echo "Building image $(RP_IMAGE_LOCAL):$(VERSION)"
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --target portal-build --no-cache=$(NO_CACHE) -t $(ARO_PORTAL_BUILD_IMAGE):$(VERSION)
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --target builder --cache-from $(ARO_PORTAL_BUILD_IMAGE) -t $(ARO_BUILDER_IMAGE):$(VERSION)
docker build . -f Dockerfile.ci-rp --ulimit=nofile=4096:4096 --build-arg REGISTRY=$(REGISTRY) --build-arg ARO_VERSION=$(VERSION) --cache-from $(ARO_BUILDER_IMAGE) -t $(RP_IMAGE_LOCAL):$(VERSION)

.PHONY: ci-tunnel
ci-tunnel: fix-macos-vendor
Expand Down
Loading