-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a65dec7
commit 73ff421
Showing
4 changed files
with
179 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,117 @@ | ||
name: 'K8S CI' | ||
description: 'K8s integration tests' | ||
inputs: | ||
elk-version: | ||
description: 'ELK version' | ||
required: true | ||
kind-config: | ||
description: 'KIND configuration' | ||
required: true | ||
container-image-suffix: | ||
description: 'Container image suffix' | ||
required: true | ||
elastic-agent-docker-image: | ||
description: 'Elastic-Agent docker image' | ||
required: true | ||
elastic-agent-docker-image-tag: | ||
description: 'Elastic-Agent docker image tag' | ||
required: true | ||
|
||
test-target: | ||
description: 'Test target' | ||
required: true | ||
test-range: | ||
description: 'Test range' | ||
required: false | ||
default: '' | ||
values-file: | ||
description: 'Helm values file' | ||
required: true | ||
runs: | ||
using: composite | ||
steps: | ||
- name: Free Disk Space (Ubuntu) | ||
uses: jlumbroso/free-disk-space@main | ||
with: | ||
tool-cache: false | ||
android: true | ||
dotnet: true | ||
haskell: true | ||
large-packages: false | ||
docker-images: true | ||
swap-storage: true | ||
|
||
- name: Build cloudbeat binary | ||
shell: bash | ||
run: mage -v build | ||
|
||
- name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- name: Build cloudbeat-docker image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: ./deploy/Dockerfile | ||
push: false | ||
tags: cloudbeat:latest | ||
#cache-from: type=local,src=/tmp/.buildx-cache | ||
#cache-to: type=local,dest=/tmp/.buildx-cache-new | ||
outputs: type=docker,dest=/tmp/cloudbeat-${{ inputs.container-image-suffix }}.tar | ||
|
||
- name: Build elastic-agent | ||
env: | ||
BASE_IMAGE: docker.elastic.co/beats/elastic-agent:${{ inputs.elastic-agent-docker-image-tag }} | ||
GOOS: linux | ||
GOARCH: amd64 | ||
shell: bash | ||
run: ./scripts/packaging/docker/elastic-agent/build.sh -t ${{ inputs.elastic-agent-docker-image }}:${{ inputs.elastic-agent-docker-image-tag }} | ||
|
||
- name: Build pytest-docker | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: ./tests/. | ||
push: false | ||
tags: cloudbeat-test:latest | ||
#cache-from: type=local,mode=max,src=/tmp/.buildx-cache | ||
#cache-to: type=local,mode=max,dest=/tmp/.buildx-cache-new | ||
outputs: type=docker,dest=/tmp/pytest-${{ inputs.container-image-suffix }}.tar | ||
|
||
- name: Prepare Kind Cluster for Process Tests | ||
if: ${{ contains(inputs.kind-config, 'conf2') }} | ||
shell: bash | ||
run: | | ||
# Workaround: Direct creation of a Kind cluster for config2 fails to start control-plane (kubelet fails) | ||
# Creating and deleting a kind-mono cluster as a preparation for configuring Kind for process tests | ||
just create-kind-cluster kind-mono | ||
just delete-kind-cluster kind-mono | ||
- name: Create k8s Kind Cluster | ||
shell: bash | ||
run: just create-kind-cluster ${{ inputs.kind-config }} | ||
|
||
- name: Load images to kind | ||
shell: bash | ||
run: ./.ci/scripts/kind-images.sh '${{ inputs.container-image-suffix }}' '${{ inputs.kind-config }}' | ||
|
||
- name: Deploy tests Helm chart | ||
id: deploy_helm | ||
shell: bash | ||
run: just deploy-tests-helm '${{ inputs.test-target }}' '${{ inputs.values-file }}' '${{ inputs.test-range }}' | ||
|
||
- name: Deploy K8s Objects | ||
if: ${{ contains(inputs.test-target, 'object_psp') }} | ||
shell: bash | ||
run: just apply-k8s-test-objects | ||
|
||
- name: Run Tests | ||
id: run_tests | ||
shell: bash | ||
run: just run-tests ${{ inputs.test-target }} kind-${{ inputs.kind-config }} | ||
|
||
- name: Upload Test Results | ||
if: always() | ||
uses: actions/upload-artifact@v4 | ||
with: | ||
name: allure-results-ci-k8s-${{ inputs.test-target }}-${{ inputs.kind-config }} | ||
path: tests/allure/results/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters