Skip to content

Commit

Permalink
Add codecov (opea-project#178)
Browse files Browse the repository at this point in the history
Signed-off-by: Sun, Xuehao <[email protected]>
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Signed-off-by: Xinyao Wang <[email protected]>
  • Loading branch information
2 people authored and XinyaoWa committed Jun 18, 2024
1 parent 44aa82f commit bdc9704
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 6 deletions.
11 changes: 6 additions & 5 deletions .github/workflows/megaservice-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down Expand Up @@ -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() }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/scripts/test_ut.sh
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand Down
11 changes: 11 additions & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -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

0 comments on commit bdc9704

Please sign in to comment.