Skip to content

Add helm e2e test workflow #106

Add helm e2e test workflow

Add helm e2e test workflow #106

# Copyright (C) 2024 Intel Corporation
# SPDX-License-Identifier: Apache-2.0
name: Examples CD workflow on manual event
on:
pull_request:
# pull_request_target:
branches: [main]
types: [opened, reopened, ready_for_review, synchronize]
# workflow_dispatch:
# inputs:
# nodes:
# default: "gaudi,xeon"
# description: "Hardware to run test"
# required: true
# type: string
# examples:
# default: "ChatQnA"
# description: 'List of examples to test [AgentQnA,AudioQnA,ChatQnA,CodeGen,CodeTrans,DocIndexRetriever,DocSum,FaqGen,InstructionTuning,MultimodalQnA,ProductivitySuite,RerankFinetuning,SearchQnA,Translation,VideoQnA,VisualQnA,AvatarChatbot,Text2Image,WorkflowExecAgent,DBQnA,EdgeCraftRAG,GraphRAG]'
# required: true
# type: string
# tag:
# default: "latest"
# description: "Tag to apply to images"
# required: true
# type: string
# deploy_gmc:
# default: false
# description: 'Whether to deploy gmc'
# required: true
# type: boolean
# build:
# default: true
# description: 'Build test required images for Examples'
# required: false
# type: boolean
# test_compose:
# default: true
# description: 'Test examples with docker compose'
# required: false
# type: boolean
# test_helmchart:
# default: false
# 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'
# required: false
# type: string
# inject_commit:
# default: false
# description: "inject commit to docker images true or false"
# required: false
# type: string
permissions: read-all
jobs:
get-test-matrix:
runs-on: ubuntu-latest
outputs:
examples: ${{ steps.get-matrix.outputs.examples }}
nodes: ${{ steps.get-matrix.outputs.nodes }}
steps:
- name: Create Matrix
id: get-matrix
run: |
# examples=($(echo ${{ inputs.examples }} | tr ',' ' '))
examples=($(echo "ChatQnA" | tr ',' ' '))
examples_json=$(printf '%s\n' "${examples[@]}" | sort -u | jq -R '.' | jq -sc '.')
echo "examples=$examples_json" >> $GITHUB_OUTPUT
# nodes=($(echo ${{ inputs.nodes }} | tr ',' ' '))
nodes=($(echo "gaudi" | tr ',' ' '))
nodes_json=$(printf '%s\n' "${nodes[@]}" | sort -u | jq -R '.' | jq -sc '.')
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) }}
fail-fast: false
uses: ./.github/workflows/_gmc-workflow.yml
with:
node: ${{ matrix.node }}
tag: ${{ inputs.tag }}
opea_branch: ${{ inputs.opea_branch }}
secrets: inherit
run-examples:
needs: [get-test-matrix, build-deploy-gmc]
if: always()
strategy:
matrix:
example: ${{ fromJson(needs.get-test-matrix.outputs.examples) }}
node: ${{ fromJson(needs.get-test-matrix.outputs.nodes) }}
fail-fast: false
uses: ./.github/workflows/_example-workflow.yml

Check failure on line 105 in .github/workflows/manual-example-workflow.yml

View workflow run for this annotation

GitHub Actions / .github/workflows/manual-example-workflow.yml

Invalid workflow file

error parsing called workflow ".github/workflows/manual-example-workflow.yml" -> "./.github/workflows/_example-workflow.yml" --> "./.github/workflows/_helm-e2e.yml" : failed to fetch workflow: workflow was not found.
with:
node: ${{ matrix.node }}
example: ${{ matrix.example }}
tag: ${{ inputs.tag }}
build: ${{ fromJSON(inputs.build) }}
test_compose: ${{ fromJSON(inputs.test_compose) }}
test_helmchart: ${{ fromJSON(inputs.test_helmchart) }}
test_gmc: ${{ fromJSON(inputs.test_gmc) }}
opea_branch: ${{ inputs.opea_branch }}
inject_commit: ${{ inputs.inject_commit }}
secrets: inherit