Skip to content

Commit da2689d

Browse files
Add codecov (#178)
Signed-off-by: Sun, Xuehao <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent 40c1aaa commit da2689d

File tree

3 files changed

+18
-6
lines changed

3 files changed

+18
-6
lines changed

.github/workflows/megaservice-test.yml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,9 @@ on:
1515
- tests/cores/**
1616
workflow_dispatch:
1717

18+
permissions:
19+
pull-requests: write
20+
1821
# If there is a new commit, the previous jobs will be canceled
1922
concurrency:
2023
group: ${{ github.workflow }}-${{ github.event.pull_request.number || github.ref }}
@@ -61,11 +64,9 @@ jobs:
6164
docker exec ${{ env.CONTAINER_NAME }} \
6265
bash -c "bash /GenAIComps/.github/workflows/scripts/test_ut.sh ${{ env.TEST_NAME }}"
6366
64-
# - name: Run Workflow
65-
# env:
66-
# HF_TOKEN: ${{ secrets.HF_TOKEN }}
67-
# run: |
68-
# xxx
67+
- uses: codecov/codecov-action@v4
68+
with:
69+
token: ${{ secrets.CODECOV_TOKEN }}
6970

7071
- name: Publish pipeline artifact
7172
if: ${{ !cancelled() }}

.github/workflows/scripts/test_ut.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ if [ $test_name = 'mega' ]; then
1414
cd cores
1515
find . -name "*.yaml" -exec sh -c 'x="{}"; cp $x ./' \;
1616
comps_path=$(python -c 'import comps; print(comps.__path__[0])')
17-
find . -name "test*.py" | sed "s,\.\/,python -m pytest --cov=\"${comps_path}\" --cov-append -vs --disable-warnings ,g" > run.sh
17+
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
1818
bash run.sh 2>&1 | tee ${ut_log_name}
1919
else
2020
echo "run other test"

codecov.yml

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# Copyright (C) 2024 Intel Corporation
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
coverage:
5+
status:
6+
project:
7+
default:
8+
informational: true
9+
patch:
10+
default:
11+
informational: true

0 commit comments

Comments
 (0)