|
40 | 40 | needs: [job1, mega-image-build]
|
41 | 41 | strategy:
|
42 | 42 | matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
|
43 |
| - runs-on: "k8s-${{ matrix.hardware }}" |
44 |
| - continue-on-error: true |
45 |
| - steps: |
46 |
| - - name: E2e test manifest |
47 |
| - run: | |
48 |
| - echo "Matrix - manifest: ${{ matrix.example }}" |
49 |
| -
|
50 |
| - - name: Clean Up Working Directory |
51 |
| - run: sudo rm -rf ${{github.workspace}}/* |
52 |
| - |
53 |
| - - name: Checkout out Repo |
54 |
| - uses: actions/checkout@v4 |
55 |
| - with: |
56 |
| - fetch-depth: 0 |
57 |
| - |
58 |
| - - name: Set variables |
59 |
| - run: | |
60 |
| - if [ ${{ matrix.hardware }} == "gaudi" ]; then IMAGE_REPO=${{ vars.IMAGE_REPO_GAUDI }}; else IMAGE_REPO=${{ vars.IMAGE_REPO_XEON }}; fi |
61 |
| - echo "IMAGE_REPO=$OPEA_IMAGE_REPO" >> $GITHUB_ENV |
62 |
| - echo "IMAGE_TAG=${{needs.mega-image-build.outputs.image_tag}}" >> $GITHUB_ENV |
63 |
| - lower_example=$(echo "${{ matrix.example }}" | tr '[:upper:]' '[:lower:]') |
64 |
| - echo "NAMESPACE=$lower_example-$(date +%Y%m%d%H%M%S)" >> $GITHUB_ENV |
65 |
| - echo "ROLLOUT_TIMEOUT_SECONDS=1800s" >> $GITHUB_ENV |
66 |
| - echo "KUBECTL_TIMEOUT_SECONDS=60s" >> $GITHUB_ENV |
67 |
| - echo "continue_test=true" >> $GITHUB_ENV |
68 |
| - echo "should_cleanup=false" >> $GITHUB_ENV |
69 |
| - echo "skip_validate=true" >> $GITHUB_ENV |
70 |
| - echo "NAMESPACE=$NAMESPACE" |
71 |
| -
|
72 |
| - - name: Kubectl install |
73 |
| - id: install |
74 |
| - run: | |
75 |
| - if [[ ! -f ${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh ]]; then |
76 |
| - echo "No test script found, exist test!" |
77 |
| - exit 0 |
78 |
| - else |
79 |
| - ${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh init_${{ matrix.example }} |
80 |
| - echo "should_cleanup=true" >> $GITHUB_ENV |
81 |
| - kubectl create ns $NAMESPACE |
82 |
| - ${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh install_${{ matrix.example }} $NAMESPACE |
83 |
| - echo "Testing ${{ matrix.example }}, waiting for pod ready..." |
84 |
| - if kubectl rollout status deployment --namespace "$NAMESPACE" --timeout "$ROLLOUT_TIMEOUT_SECONDS"; then |
85 |
| - echo "Testing manifests ${{ matrix.example }}, waiting for pod ready done!" |
86 |
| - echo "skip_validate=false" >> $GITHUB_ENV |
87 |
| - else |
88 |
| - echo "Timeout waiting for pods in namespace $NAMESPACE to be ready!" |
89 |
| - exit 1 |
90 |
| - fi |
91 |
| - sleep 60 |
92 |
| - fi |
93 |
| -
|
94 |
| - - name: Validate e2e test |
95 |
| - if: always() |
96 |
| - run: | |
97 |
| - if $skip_validate; then |
98 |
| - echo "Skip validate" |
99 |
| - else |
100 |
| - ${{ github.workspace }}/${{ matrix.example }}/tests/test_manifest_on_${{ matrix.hardware }}.sh validate_${{ matrix.example }} $NAMESPACE |
101 |
| - fi |
102 |
| -
|
103 |
| - - name: Kubectl uninstall |
104 |
| - if: always() |
105 |
| - run: | |
106 |
| - if $should_cleanup; then |
107 |
| - if ! kubectl delete ns $NAMESPACE --timeout=$KUBECTL_TIMEOUT_SECONDS; then |
108 |
| - kubectl delete pods --namespace $NAMESPACE --force --grace-period=0 --all |
109 |
| - kubectl delete ns $NAMESPACE --force --grace-period=0 --timeout=$KUBECTL_TIMEOUT_SECONDS |
110 |
| - fi |
111 |
| - fi |
| 43 | + uses: ./.github/workflows/_manifest-e2e.yml |
| 44 | + with: |
| 45 | + example: ${{ matrix.example }} |
| 46 | + hardware: ${{ matrix.hardware }} |
| 47 | + tag: ${{ needs.mega-image-build.outputs.image_tag }} |
| 48 | + secrets: inherit |
0 commit comments