Skip to content

Commit

Permalink
message
Browse files Browse the repository at this point in the history
  • Loading branch information
moukoublen committed Mar 22, 2024
1 parent 19d7c1c commit 8fd6840
Show file tree
Hide file tree
Showing 3 changed files with 53 additions and 14 deletions.
11 changes: 7 additions & 4 deletions .github/actions/docker-images/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ runs:
uses: actions/cache@v4
with:
path: /tmp/docker-images/
key: ci-docker-images-${{ runner.os }}-${{ runner.arch }}-${{ github.workflow }}-${{ inputs.container-image-suffix }}
key: ci-docker-images-${{ runner.os }}-${{ runner.arch }}-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}

- name: Build cloudbeat-docker image
uses: docker/build-push-action@v5
Expand All @@ -65,7 +65,8 @@ runs:
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/docker-images/cloudbeat-${{ inputs.container-image-suffix }}.tar
outputs: type=docker,dest=/tmp/docker-images/cloudbeat.tar
no-cache: false

- name: Build elastic-agent
uses: docker/build-push-action@v5
Expand All @@ -80,8 +81,9 @@ runs:
tags: ${{ inputs.elastic-agent-docker-image }}:${{ inputs.elastic-agent-docker-image-tag }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
outputs: type=docker,dest=/tmp/docker-images/elastic-agent-${{ inputs.container-image-suffix }}.tar
outputs: type=docker,dest=/tmp/docker-images/elastic-agent.tar
build-args: ELASTIC_AGENT_IMAGE=docker.elastic.co/beats/elastic-agent:${{ inputs.elastic-agent-docker-image-tag }}
no-cache: false

- name: Build pytest-docker
uses: docker/build-push-action@v5
Expand All @@ -91,7 +93,8 @@ runs:
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/docker-images/pytest-${{ inputs.container-image-suffix }}.tar
outputs: type=docker,dest=/tmp/docker-images/pytest.tar
no-cache: false

- name: Rotate cache
shell: bash
Expand Down
13 changes: 5 additions & 8 deletions .github/actions/k8s-ci/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ inputs:
kind-config:
description: 'KIND configuration'
required: true
container-image-suffix:
container-image-suffix: # todo: remove
description: 'Container image suffix'
required: true
elastic-agent-docker-image:
Expand Down Expand Up @@ -48,7 +48,7 @@ runs:
uses: actions/cache@v4
with:
path: /tmp/docker-images/
key: ci-docker-images-${{ runner.os }}-${{ runner.arch }}-${{ github.workflow }}-${{ inputs.container-image-suffix }}
key: ci-docker-images-${{ runner.os }}-${{ runner.arch }}-${{ github.workflow }}-${{ github.head_ref || github.ref_name }}

- name: Prepare Kind Cluster for Process Tests
if: ${{ contains(inputs.kind-config, 'conf2') }}
Expand All @@ -63,16 +63,13 @@ runs:
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: Load images to kind
shell: bash
run: |
ls -lahR /tmp/docker-images/
kind load image-archive /tmp/docker-images/cloudbeat-${{ inputs.container-image-suffix }}.tar --name='${{ inputs.kind-config }}'
kind load image-archive /tmp/docker-images/pytest-${{ inputs.container-image-suffix }}.tar --name='${{ inputs.kind-config }}'
kind load image-archive /tmp/docker-images/elastic-agent-${{ inputs.container-image-suffix }}.tar --name='${{ inputs.kind-config }}'
kind load image-archive /tmp/docker-images/cloudbeat.tar --name='${{ inputs.kind-config }}'
kind load image-archive /tmp/docker-images/pytest.tar --name='${{ inputs.kind-config }}'
kind load image-archive /tmp/docker-images/elastic-agent.tar --name='${{ inputs.kind-config }}'
- name: Deploy tests Helm chart
id: deploy_helm
Expand Down
43 changes: 41 additions & 2 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -286,8 +286,17 @@ jobs:
name: Upload integration tests results
runs-on: ubuntu-22.04
timeout-minutes: 60
permissions:
pull-requests: write
if: ${{ success() || failure() }}
env:
AWS_REGION: "eu-west-1"
ALLURE_S3_BUCKET: "s3://csp-allure-reports/allure_reports/cloudbeat/ci"
S3_BUCKET_ALLURE_REPORT_AP: "http://csp-allure-reports.s3.amazonaws.com/allure_reports/cloudbeat/ci"
steps:
- name: Check out the repo
uses: actions/checkout@v4

- uses: actions/download-artifact@v4
if: ${{ success() || failure() }}
with:
Expand All @@ -306,7 +315,7 @@ jobs:
uses: andrcuns/allure-publish-action@v2.6.0
env:
GITHUB_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
AWS_REGION: eu-west-1
AWS_REGION: ${{ env.AWS_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
with:
Expand All @@ -320,4 +329,34 @@ jobs:
bucket: csp-allure-reports
prefix: allure_reports/cloudbeat/ci/${{ github.event.number }}
ignoreMissingResults: true
debug: true
debug: false

- name: Allure Summary
if: ${{ success() && github.event_name == 'pull_request' }}
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
ls -lahR ./tests/allure/results/ || true
allure_result=./tests/allure/results/history-trend.json
allure_url=${{ env.S3_BUCKET_ALLURE_REPORT_AP }}/${{ github.event.number }}/index.html
./.ci/scripts/allure-report-summary.sh "$allure_result" "$allure_url"
allure_summary=$(./.ci/scripts/allure-report-summary.sh "$allure_result" "$allure_url")
# posting result into job summary
echo "$allure_summary" >> $GITHUB_STEP_SUMMARY
# saving result into env variable (with multiline handling)
echo "ALLURE_SUMMARY<<EOF" >> $GITHUB_ENV
echo "$allure_summary" >> $GITHUB_ENV
echo "EOF" >> $GITHUB_ENV
- name: Comment test success result
uses: marocchino/sticky-pull-request-comment@v2
if: ${{ success() && github.event_name == 'pull_request' }}
with:
header: CI Test Results
number: ${{ github.event.number }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
message: |
${{ env.ALLURE_SUMMARY }}

0 comments on commit 8fd6840

Please sign in to comment.