added doc sum react-ui #168
Workflow file for this run
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
# Copyright (C) 2024 Intel Corporation | |
# SPDX-License-Identifier: Apache-2.0 | |
name: E2E test with manifests | |
on: | |
pull_request: | |
branches: [main] | |
types: [opened, reopened, ready_for_review, synchronize] # added `ready_for_review` since draft is skipped | |
paths: | |
- "**/kubernetes/manifests/**" | |
- "**/tests/test_manifest**" | |
- "!**.md" | |
- "!**.txt" | |
workflow_dispatch: | |
concurrency: | |
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} | |
cancel-in-progress: true | |
jobs: | |
job1: | |
uses: ./.github/workflows/reuse-get-test-matrix.yml | |
with: | |
diff_excluded_files: '.github|deprecated|docker|assets|*.md|*.txt' | |
xeon_server_label: 'xeon' | |
gaudi_server_label: 'gaudi' | |
mega-image-build: | |
needs: job1 | |
strategy: | |
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }} | |
uses: ./.github/workflows/reuse-image-build.yml | |
with: | |
image_tag: ${{ github.event.pull_request.head.sha }} | |
mega_service: "${{ matrix.example }}" | |
runner_label: "docker-build-${{ matrix.hardware }}" | |
manifest-test: | |
needs: [job1, mega-image-build] | |
strategy: | |
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }} | |
runs-on: "k8s-${{ matrix.hardware }}" | |
continue-on-error: true | |
steps: | |
- name: E2e test manifest | |
run: | | |
echo "Matrix - manifest: ${{ matrix.example }}" | |
- name: Clean Up Working Directory | |
run: sudo rm -rf ${{github.workspace}}/* | |
- name: Checkout out Repo | |
uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: Set variables | |
run: | | |
if [ ${{ matrix.hardware }} == "gaudi" ]; then IMAGE_REPO=${{ vars.IMAGE_REPO_GAUDI }}; else IMAGE_REPO=${{ vars.IMAGE_REPO_XEON }}; fi | |
echo "IMAGE_REPO=$OPEA_IMAGE_REPO" >> $GITHUB_ENV | |
echo "IMAGE_TAG=${{needs.mega-image-build.outputs.image_tag}}" >> $GITHUB_ENV | |
lower_example=$(echo "${{ matrix.example }}" | tr '[:upper:]' '[:lower:]') | |
echo "NAMESPACE=$lower_example-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV | |
echo "ROLLOUT_TIMEOUT_SECONDS=1800s" >> $GITHUB_ENV | |
echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV | |
echo "continue_test=true" >> $GITHUB_ENV | |
echo "should_cleanup=false" >> $GITHUB_ENV | |
echo "skip_validate=true" >> $GITHUB_ENV | |
echo "NAMESPACE=$NAMESPACE" | |
- name: Kubectl install | |
id: install | |
run: | | |
if [[ ! -f ${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh ]]; then | |
echo "No test script found, exist test!" | |
exit 0 | |
else | |
${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh init_${{ matrix.example }} | |
echo "should_cleanup=true" >> $GITHUB_ENV | |
kubectl create ns $NAMESPACE | |
${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh install_${{ matrix.example }} $NAMESPACE | |
echo "Testing ${{ matrix.example }}, waiting for pod ready..." | |
if kubectl rollout status deployment --namespace "$NAMESPACE" --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then | |
echo "Testing manifests ${{ matrix.example }}, waiting for pod ready done!" | |
echo "skip_validate=false" >> $GITHUB_ENV | |
else | |
echo "Timeout waiting for pods in namespace $NAMESPACE to be ready!" | |
exit 1 | |
fi | |
sleep 60 | |
fi | |
- name: Validate e2e test | |
if: always() | |
run: | | |
if $skip_validate; then | |
echo "Skip validate" | |
else | |
${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh validate_${{ matrix.example }} $NAMESPACE | |
fi | |
- name: Kubectl uninstall | |
if: always() | |
run: | | |
if $should_cleanup; then | |
if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then | |
kubectl delete pods --namespace $NAMESPACE --force --grace-period=0 --all | |
kubectl delete ns $NAMESPACE --force --grace-period=0 --timeout=$KUBECTL_TIMEOUT_SECONDS | |
fi | |
fi |