github.com/milvus-io/milvus-sdk-go/v2@v2.4.1/.github/workflows/test-ci.yaml (about)

     1  name: Test CI
     2  on:
     3    push:
     4      branches:
     5        - master
     6    pull_request:
     7      paths:
     8        - 'common/**'
     9        - 'client/**'
    10        - 'entity/**'
    11        - 'internal/**'
    12        - 'test/**'
    13        - 'tests/**'
    14        - 'merr/**'
    15  jobs:
    16    test:
    17      name: Run Ci Test
    18      runs-on: ubuntu-latest
    19      timeout-minutes: 90
    20      strategy:
    21        matrix:
    22          mode: [standalone, cluster]
    23      env:
    24        IMAGE_REPO: "milvusdb/milvus"
    25        TAG_PREFIX: "master-"
    26        RELEASE_NAME: "go-test"
    27        IMAGE_TAG: "master-latest"
    28        QA_NAMESPACE: "qa"
    29      steps:
    30        - name: Checkout code
    31          uses: actions/checkout@v3
    32          with:
    33            fetch-depth: '0'
    34  
    35        - name: Get the latest of Milvus image tag
    36          shell: bash
    37          working-directory: ci/scripts
    38          run: |
    39            url="https://registry.hub.docker.com/v2/repositories/$IMAGE_REPO/tags?page=1&name=$TAG_PREFIX"
    40            echo "IMAGE_TAG=$(curl -s $url | jq -r '."results"[]["name"] | select(test("amd64$"))' | head -n 1)" >> $GITHUB_ENV
    41  #          echo "IMAGE_TAG=$(./docker_image_find_tag.sh -n ${IMAGE_REPO} -t ${TAG_PREFIX}latest -f ${TAG_PREFIX} -F -L -q)" >> $GITHUB_ENV
    42  #          export IMAGE_TAG=$IMAGE_TAG
    43  #          export IMAGE_REPO=$IMAGE_REPO
    44  #          export RELEASE_NAME=$RELEASE_NAME
    45  
    46        - name: Creating kind cluster
    47          uses: helm/kind-action@v1.3.0
    48  
    49        - name: Deploy milvus operator
    50          shell: bash
    51          run: |
    52            kubectl get sc
    53            helm install milvus-operator -n milvus-operator --create-namespace https://github.com/milvus-io/milvus-operator/releases/download/v0.6.9/milvus-operator-0.6.9.tgz
    54            kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=milvus-operator -n milvus-operator
    55            kubectl get pods -n milvus-operator
    56  
    57        - name: Install Milvus
    58          shell: bash
    59          working-directory: ci/milvus-operator
    60          run: |
    61            echo "IMAGE_REPO=$IMAGE_REPO, IMAGE_TAG=$IMAGE_TAG, RELEASE_NAME=$RELEASE_NAME"
    62            kubectl create namespace ${QA_NAMESPACE}
    63            envsubst < milvus-${{ matrix.mode }}.yaml | cat - | kubectl apply -f - -n ${QA_NAMESPACE}
    64            kubectl -n ${QA_NAMESPACE} wait --for=condition=MilvusReady milvus/${RELEASE_NAME} --timeout 20m
    65            kubectl --timeout 20m wait --for=condition=ready pod -l app.kubernetes.io/instance=${RELEASE_NAME} -n ${QA_NAMESPACE}
    66            kubectl describe milvus ${RELEASE_NAME} -n ${QA_NAMESPACE}
    67            kubectl get pod -o wide -n ${QA_NAMESPACE} | grep -E "NAME|${RELEASE_NAME}"
    68            kubectl get svc -n ${QA_NAMESPACE}
    69            kubectl port-forward service/${RELEASE_NAME}-milvus 19530 -n ${QA_NAMESPACE} >/dev/null 2>&1 & sleep 10s
    70  
    71        - name: Run Ci Test
    72          shell: bash
    73          working-directory: test/
    74          run: |
    75            nc -vz 127.0.0.1 19530
    76            curl -sSL "https://github.com/gotestyourself/gotestsum/releases/download/v1.8.2/gotestsum_1.8.2_linux_amd64.tar.gz" | sudo tar -xz -C /usr/local/bin gotestsum
    77            gotestsum --format testname --hide-summary=output ./testcases/... --tags L0 --addr=127.0.0.1:19530 -timeout=60m
    78  
    79        - name: Export logs
    80          if: ${{ !success() }}
    81          shell: bash
    82          working-directory: ci/scripts/
    83          run: |
    84            bash ./export_log_k8s_for_operator.sh ${QA_NAMESPACE} ${RELEASE_NAME} milvus_logs/
    85  
    86        - name: Archive logs
    87          if: ${{ !success() }}
    88          uses: actions/upload-artifact@v3
    89          with:
    90            name: milvus-logs-${{ matrix.mode }}
    91            path: |
    92              ci/scripts/milvus_logs/
    93