From c016d8264a1bd8fc69724ffa613640dabb3e7cb1 Mon Sep 17 00:00:00 2001 From: "chen, suyue" Date: Mon, 19 Aug 2024 22:24:13 +0800 Subject: [PATCH] update deploy_gmc logical in cd workflow (#627) * update deploy_gmc logical Signed-off-by: chensuyue * bug fix Signed-off-by: chensuyue * add always() for run-examples Signed-off-by: chensuyue * bug fix Signed-off-by: chensuyue --------- Signed-off-by: chensuyue --- .github/workflows/_gmc-workflow.yml | 25 +++++++++---------- .github/workflows/manual-example-workflow.yml | 13 ++++++++-- 2 files changed, 23 insertions(+), 15 deletions(-) diff --git a/.github/workflows/_gmc-workflow.yml b/.github/workflows/_gmc-workflow.yml index a275b980c..2affcc847 100644 --- a/.github/workflows/_gmc-workflow.yml +++ b/.github/workflows/_gmc-workflow.yml @@ -16,11 +16,11 @@ on: required: true type: string description: "Hardware to run test" - deploy: - default: true - required: true - type: boolean - description: 'Whether to deploy gmc' + opea_branch: + default: "main" + required: false + type: string + description: 'OPEA branch for image build' workflow_call: inputs: tag: @@ -33,11 +33,11 @@ on: required: true type: string description: "Hardware to run test" - deploy: - default: true - required: true - type: boolean - description: 'Whether to deploy gmc' + opea_branch: + default: "main" + required: false + type: string + description: 'OPEA branch for image build' jobs: #################################################################################################### @@ -50,7 +50,7 @@ jobs: uses: actions/checkout@v4 with: repository: opea-project/GenAIInfra - ref: ${{ inputs.tag }} + ref: ${{ inputs.opea_branch }} path: GenAIInfra - name: Set variables @@ -113,14 +113,13 @@ jobs: #################################################################################################### gmc-install: needs: image-build - if: ${{ fromJSON(inputs.deploy) }} runs-on: "k8s-${{ inputs.node }}" steps: - name: Checkout GenAIInfra repository uses: actions/checkout@v4 with: repository: opea-project/GenAIInfra - ref: ${{ inputs.tag }} + ref: ${{ inputs.opea_branch }} path: GenAIInfra - name: Set variables diff --git a/.github/workflows/manual-example-workflow.yml b/.github/workflows/manual-example-workflow.yml index 99e63fd3a..5c70deed2 100644 --- a/.github/workflows/manual-example-workflow.yml +++ b/.github/workflows/manual-example-workflow.yml @@ -45,6 +45,11 @@ on: description: 'Test examples with k8s' required: false type: boolean + test_gmc: + default: false + description: 'Test examples with gmc' + required: false + type: boolean opea_branch: default: "main" description: 'OPEA branch for image build' @@ -70,6 +75,8 @@ jobs: echo "nodes=$nodes_json" >> $GITHUB_OUTPUT build-deploy-gmc: + needs: [get-test-matrix] + if: ${{ fromJSON(inputs.deploy_gmc) }} strategy: matrix: node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }} @@ -78,11 +85,12 @@ jobs: with: node: ${{ matrix.node }} tag: ${{ inputs.tag }} - deploy: ${{ fromJSON(inputs.deploy_gmc) }} + opea_branch: ${{ inputs.opea_branch }} secrets: inherit run-examples: - needs: [get-test-matrix] + needs: [get-test-matrix, build-deploy-gmc] + if: always() strategy: matrix: example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }} @@ -97,5 +105,6 @@ jobs: scan: ${{ fromJSON(inputs.scan) }} test_compose: ${{ fromJSON(inputs.test_compose) }} test_k8s: ${{ fromJSON(inputs.test_k8s) }} + test_gmc: ${{ fromJSON(inputs.test_gmc) }} opea_branch: ${{ inputs.opea_branch }} secrets: inherit