diff --git a/.github/workflows/core.yml b/.github/workflows/core.yml index c1c09e01df9f346b650c95007995a96a7228741d..d571a4eb33fb2a90e95e314da805edd6b598554c 100644 --- a/.github/workflows/core.yml +++ b/.github/workflows/core.yml @@ -31,7 +31,7 @@ jobs: - name: Docker Build run: | docker-compose run --use-aliases -d db - docker-compose run ubuntu-core + docker-compose run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} ubuntu-core - name: Docker Push if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' continue-on-error: true @@ -61,7 +61,7 @@ jobs: - name: Docker Build run: | docker-compose run --use-aliases -d db - docker-compose run centos-core + docker-compose run -e CODECOV_TOKEN=${{ secrets.CODECOV_TOKEN }} centos-core - name: Docker Push if: success() && github.event_name == 'push' && github.repository == 'milvus-io/milvus' continue-on-error: true diff --git a/ci/jenkins/Jenkinsfile b/ci/jenkins/Jenkinsfile index a98a3df3368d7ddcf7605346ac640f38a214705a..c3e66baa92ff6579ad2f674d67f29394ee1ecb97 100644 --- a/ci/jenkins/Jenkinsfile +++ b/ci/jenkins/Jenkinsfile @@ -66,7 +66,7 @@ pipeline { stage('Run Build') { agent { kubernetes { - label "${BINRARY_VERSION}-build" + label "${OS_NAME}-${BINRARY_VERSION}-build" defaultContainer 'jnlp' yamlFile "ci/jenkins/pod/milvus-${BINRARY_VERSION}-version-${OS_NAME}-build-env-pod.yaml" } @@ -87,7 +87,11 @@ pipeline { steps { container("milvus-${BINRARY_VERSION}-build-env") { script { - load "${env.WORKSPACE}/ci/jenkins/step/coverage.groovy" + if ("${BINRARY_VERSION}" == "gpu") { + load "${env.WORKSPACE}/ci/jenkins/step/coverage.groovy" + } else { + echo "Skip Code Coverage" + } } } } @@ -108,7 +112,7 @@ pipeline { stage('Publish docker images') { agent { kubernetes { - label "${BINRARY_VERSION}-publish" + label "${OS_NAME}-${BINRARY_VERSION}-publish" defaultContainer 'jnlp' yamlFile 'ci/jenkins/pod/docker-pod.yaml' } @@ -130,12 +134,12 @@ pipeline { stage('Deploy to Development') { environment { FROMAT_SEMVER = "${env.SEMVER}".replaceAll("\\.", "-") - HELM_RELEASE_NAME = "${env.PIPELINE_NAME}-${env.FROMAT_SEMVER}-${env.BUILD_NUMBER}-single-${BINRARY_VERSION}".toLowerCase() + HELM_RELEASE_NAME = "${env.PIPELINE_NAME}-${env.FROMAT_SEMVER}-${env.BUILD_NUMBER}-single-${OS_NAME}-${BINRARY_VERSION}".toLowerCase() } agent { kubernetes { - label "${BINRARY_VERSION}-dev-test" + label "${OS_NAME}-${BINRARY_VERSION}-dev-test" defaultContainer 'jnlp' yamlFile 'ci/jenkins/pod/testEnvironment.yaml' } diff --git a/ci/scripts/coverage.sh b/ci/scripts/coverage.sh index 2df0cdbeb0e01ce90b970e661bc30b0721220dd9..2cd502870ffb6784c63e829c43079b488fdcdfb3 100755 --- a/ci/scripts/coverage.sh +++ b/ci/scripts/coverage.sh @@ -13,10 +13,11 @@ MILVUS_CORE_DIR="${SCRIPTS_DIR}/../../core" CORE_BUILD_DIR="${MILVUS_CORE_DIR}/cmake_build" MYSQL_USER_NAME=root MYSQL_PASSWORD=123456 -MYSQL_HOST='127.0.0.1' -MYSQL_PORT='3306' +MYSQL_HOST="127.0.0.1" +MYSQL_PORT="3306" +CODECOV_TOKEN="" -while getopts "o:b:u:p:t:h" arg +while getopts "o:b:u:p:t:c:h" arg do case $arg in o) @@ -34,6 +35,9 @@ do t) MYSQL_HOST=$OPTARG ;; + c) + CODECOV_TOKEN=$OPTARG + ;; h) # help echo " @@ -43,10 +47,11 @@ parameter: -u: mysql account -p: mysql password -t: mysql host +-c: codecov token -h: help usage: -./coverage.sh -o \${INSTALL_PREFIX} -b \${CORE_BUILD_DIR} -u \${MYSQL_USER} -p \${MYSQL_PASSWORD} -t \${MYSQL_HOST} [-h] +./coverage.sh -o \${INSTALL_PREFIX} -b \${CORE_BUILD_DIR} -u \${MYSQL_USER} -p \${MYSQL_PASSWORD} -t \${MYSQL_HOST} -c \${CODECOV_TOKEN} [-h] " exit 0 ;; @@ -146,5 +151,7 @@ if [ $? -ne 0 ]; then exit 2 fi -# gen html report -# ${LCOV_GEN_CMD} "${FILE_INFO_OUTPUT_NEW}" --output-directory ${DIR_LCOV_OUTPUT}/ +if [[ ! -z ${CODECOV_TOKEN} ]];then + export CODECOV_TOKEN="${CODECOV_TOKEN}" + curl -s https://codecov.io/bash | bash -s - -f output_new.info || echo "Codecov did not collect coverage reports" +fi diff --git a/docker-compose.yml b/docker-compose.yml index 4eda37f48858b8e7e0095859a7018d847c0f5237..d47b22344205ebf1c6bc686434115e2b8a62660b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -41,7 +41,7 @@ services: command: &ubuntu-command > /bin/bash -c " /milvus/ci/scripts/build.sh -t Release -o ${MILVUS_INSTALL_PREFIX} -l -u -c - /milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql" + /milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql -c ${CODECOV_TOKEN}" centos-core: image: ${REPO}:${ARCH}-centos-${CENTOS}-core @@ -63,7 +63,7 @@ services: source scl_source enable devtoolset-7 source scl_source enable llvm-toolset-7.0 /milvus/ci/scripts/build.sh -t Release -o ${MILVUS_INSTALL_PREFIX} -l -u -c - /milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql" + /milvus/ci/scripts/coverage.sh -o ${MILVUS_INSTALL_PREFIX} -u root -p 123456 -t mysql -c ${CODECOV_TOKEN}" networks: milvus: