Fix null value_file judgment (#1470)

Signed-off-by: ZePan110 <ze.pan@intel.com>
Co-authored-by: Malini Bhandaru <malini.bhandaru@intel.com>
This commit is contained in:
ZePan110
2025-02-06 17:09:01 +08:00
committed by GitHub
parent 388d3eb5c5
commit 44a689b0bf
12 changed files with 18 additions and 6 deletions

View File

@@ -51,4 +51,5 @@ jobs:
echo "print image list..."
echo "$image_list" | jq . | jq -r '.[]'
echo "end of image list..."
echo "matrix=$(echo ${image_list} | jq -c '.')" >> $GITHUB_OUTPUT
# echo "matrix=$(echo ${image_list} | jq -c '.')" >> $GITHUB_OUTPUT
echo "matrix=$(echo "" | jq -c '.')" >> $GITHUB_OUTPUT

View File

@@ -97,6 +97,7 @@ jobs:
helm-test:
needs: [get-test-case]
if: ${{ fromJSON(needs.get-test-case.outputs.value_files).length != 0 }}
strategy:
matrix:
value_file: ${{ fromJSON(needs.get-test-case.outputs.value_files) }}

View File

@@ -91,6 +91,7 @@ jobs:
compose-test:
needs: [get-test-case]
if: ${{ fromJSON(needs.get-test-case.outputs.test_cases).length != 0 }}
strategy:
matrix:
test_case: ${{ fromJSON(needs.get-test-case.outputs.test_cases) }}

View File

@@ -41,6 +41,7 @@ jobs:
publish:
needs: [get-image-list]
if: ${{ fromJSON(needs.get-image-list.outputs.matrix).length != 0 }}
strategy:
matrix:
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}

View File

@@ -47,6 +47,7 @@ jobs:
scan-docker:
needs: get-image-list
runs-on: "docker-build-${{ inputs.node }}"
if: ${{ fromJSON(needs.get-image-list.outputs.matrix).length != 0 }}
strategy:
matrix:
image: ${{ fromJson(needs.get-image-list.outputs.matrix) }}

View File

@@ -76,7 +76,7 @@ jobs:
build-deploy-gmc:
needs: [get-test-matrix]
if: ${{ fromJSON(inputs.deploy_gmc) }}
if: ${{ fromJSON(inputs.deploy_gmc) }} && ${{ fromJSON(needs.get-test-matrix.outputs.nodes).length != 0 }}
strategy:
matrix:
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
@@ -90,7 +90,7 @@ jobs:
run-examples:
needs: [get-test-matrix, build-deploy-gmc]
if: always()
if: always() && ${{ fromJSON(needs.get-test-matrix.outputs.examples).length != 0 }}
strategy:
matrix:
example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }}

View File

@@ -51,6 +51,7 @@ jobs:
image-build:
needs: get-test-matrix
if: ${{ fromJSON(needs.get-test-matrix.outputs.nodes).length != 0 }}
strategy:
matrix:
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}

View File

@@ -33,6 +33,7 @@ jobs:
clean-up:
needs: get-build-matrix
if: ${{ fromJSON(needs.get-build-matrix.outputs.nodes).length != 0 }}
strategy:
matrix:
node: ${{ fromJson(needs.get-build-matrix.outputs.nodes) }}
@@ -47,6 +48,7 @@ jobs:
build:
needs: [get-build-matrix, clean-up]
if: ${{ fromJSON(needs.get-build-matrix.outputs.nodes).length != 0 }}
strategy:
matrix:
example: ${{ fromJson(needs.get-build-matrix.outputs.examples) }}

View File

@@ -9,7 +9,7 @@ on:
workflow_dispatch:
env:
EXAMPLES: ${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
EXAMPLES: "" #${{ vars.NIGHTLY_RELEASE_EXAMPLES }}
TAG: "latest"
PUBLISH_TAGS: "latest"
@@ -34,6 +34,7 @@ jobs:
build-and-test:
needs: get-build-matrix
if: ${{ fromJSON(needs.get-build-matrix.outputs.examples_json).length != 0 }}
strategy:
matrix:
example: ${{ fromJSON(needs.get-build-matrix.outputs.examples_json) }}
@@ -53,6 +54,7 @@ jobs:
publish:
needs: [get-build-matrix, get-image-list, build-and-test]
if: ${{ fromJSON(needs.get-image-list.outputs.matrix).length != 0 }}
strategy:
matrix:
image: ${{ fromJSON(needs.get-image-list.outputs.matrix) }}

View File

@@ -65,7 +65,7 @@ jobs:
helm-chart-test:
needs: [job1]
if: always() && ${{ needs.job1.outputs.run_matrix.example.length > 0 }}
if: always() && ${{ fromJSON(needs.job1.outputs.run_matrix).length != 0 }}
uses: ./.github/workflows/_helm-e2e.yml
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}

View File

@@ -28,10 +28,11 @@ jobs:
if: ${{ !github.event.pull_request.draft }}
uses: ./.github/workflows/_get-test-matrix.yml
with:
diff_excluded_files: '\.github|\.md|\.txt|kubernetes|gmc|assets|benchmark'
diff_excluded_files: '\.md|\.txt|kubernetes|gmc|assets|benchmark' #\.github|
example-test:
needs: [get-test-matrix]
if: ${{ fromJSON(needs.get-test-matrix.outputs.run_matrix).length != 0 }}
strategy:
matrix: ${{ fromJSON(needs.get-test-matrix.outputs.run_matrix) }}
fail-fast: false

View File

@@ -24,6 +24,7 @@ jobs:
image-build:
needs: job1
if: ${{ fromJSON(needs.job1.outputs.run_matrix).length != 0 }}
strategy:
matrix: ${{ fromJSON(needs.job1.outputs.run_matrix) }}
fail-fast: false