diff --git a/.github/workflows/megaservice-test.yml b/.github/workflows/megaservice-test.yml index f6f2a14c4..ea056041d 100644 --- a/.github/workflows/megaservice-test.yml +++ b/.github/workflows/megaservice-test.yml @@ -15,6 +15,9 @@ on: - tests/cores/** workflow_dispatch: +permissions: + pull-requests: write + # If there is a new commit, the previous jobs will be canceled concurrency: group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }} @@ -61,11 +64,9 @@ jobs: docker exec ${{ env.CONTAINER_NAME }} \ bash -c "bash /GenAIComps/.github/workflows/scripts/test_ut.sh ${{ env.TEST_NAME }}" - # - name: Run Workflow - # env: - # HF_TOKEN: ${{ secrets.HF_TOKEN }} - # run: | - # xxx + - uses: codecov/codecov-action@v4 + with: + token: ${{ secrets.CODECOV_TOKEN }} - name: Publish pipeline artifact if: ${{ !cancelled() }} diff --git a/.github/workflows/scripts/test_ut.sh b/.github/workflows/scripts/test_ut.sh index 887e996cd..8952cc3c5 100644 --- a/.github/workflows/scripts/test_ut.sh +++ b/.github/workflows/scripts/test_ut.sh @@ -14,7 +14,7 @@ if [ $test_name = 'mega' ]; then cd cores find . -name "*.yaml" -exec sh -c 'x="{}"; cp $x ./' \; comps_path=$(python -c 'import comps; print(comps.__path__[0])') - find . -name "test*.py" | sed "s,\.\/,python -m pytest --cov=\"${comps_path}\" --cov-append -vs --disable-warnings ,g" > run.sh + find . -name "test*.py" | sed "s,\.\/,python -m pytest --cov=\"${comps_path}\" --cov-report term --cov-report xml:coverage.xml --cov-append -vs --disable-warnings ,g" > run.sh bash run.sh 2>&1 | tee ${ut_log_name} else echo "run other test" diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..3a2cda813 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,11 @@ +# Copyright (C) 2024 Intel Corporation +# SPDX-License-Identifier: Apache-2.0 + +coverage: + status: + project: + default: + informational: true + patch: + default: + informational: true