[Tool] fe coverage in pipeline (#21630)

add fe coverage in pipeline
Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
This commit is contained in:
andyziye 2023-04-14 17:25:56 +08:00 committed by GitHub
parent 5af938d783
commit d0c867af11
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 55 additions and 7 deletions

View File

@ -248,8 +248,11 @@ jobs:
env:
PR_NUMBER: ${{ github.event.number }}
steps:
- name: Clean Workspace
uses: AutoModality/action-clean@v1.1.0
- name: clean
run: |
set -x
echo ${{ github.workspace }}
rm -rf ${{ github.workspace }}/*
- name: BRANCH INFO
id: branch
@ -257,6 +260,21 @@ jobs:
echo ${{github.base_ref}}
echo "branch=${{github.base_ref}}" >> $GITHUB_OUTPUT
- uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Checkout PR
run: |
BRANCH=${{steps.branch.outputs.branch}}
git checkout $BRANCH;
git pull;
BRANCH_NAME="${BRANCH}-${PR_NUMBER}";
git fetch origin pull/${PR_NUMBER}/head:${BRANCH_NAME};
git checkout $BRANCH_NAME;
git checkout -b merge_pr;
git merge --squash --no-edit ${BRANCH} || (echo "Merge conflict, please check." && exit -1);
- name: UPDATE ECI & RUN UT
id: run_ut
shell: bash
@ -266,13 +284,23 @@ jobs:
rm -rf ./elastic-service
ln -s /var/lib/elastic-service ./elastic-service
cd elastic-service && git pull
./bin/elastic-ut.sh --pr ${PR_NUMBER} --module fe
./bin/elastic-ut.sh --pr ${PR_NUMBER} --module fe --branch ${{steps.branch.outputs.branch}}
- name: Clean ECI
if: always()
- run: echo ${{ steps.run_ut.outputs.COV_DIR }}/${{ steps.run_ut.outputs.COV_FILE }}
- name: copy cov
run: |
echo ${{ steps.run_ut.outputs.ECI_ID }}
eci rm ${{ steps.run_ut.outputs.ECI_ID }}
cd ${{ github.workspace }}/fe/fe-core
cp -rf ${{ steps.run_ut.outputs.COV_DIR }} target/
- uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ${{ github.workspace }}/fe/fe-core/target/${{ steps.run_ut.outputs.COV_FILE }}
dry_run: false
name: fe-ut
fail_ci_if_error: false
verbose: true
- name: UT Report
if: always()
@ -283,6 +311,12 @@ jobs:
token: ${{ secrets.GITHUB_TOKEN }}
report_paths: ${{ steps.run_ut.outputs.FE_REPORT_DIR }}/*.xml
- name: Clean ECI
if: always()
run: |
echo ${{ steps.run_ut.outputs.ECI_ID }}
eci rm ${{ steps.run_ut.outputs.ECI_ID }}
- name: Upload log
if: always()
uses: actions/upload-artifact@v3
@ -297,6 +331,7 @@ jobs:
rm -rf ${{ steps.run_ut.outputs.FE_REPORT_DIR }}
rm -f ${{ steps.run_ut.outputs.RES_FILE }}
rm -f ${{ steps.run_ut.outputs.RES_LOG }}
rm -rf ${{ steps.run_ut.outputs.COV_DIR }}
build:
runs-on: self-hosted

13
codecov.yml Normal file
View File

@ -0,0 +1,13 @@
comment:
layout: "newheader, diff, flags, files, newfooter"
coverage:
status:
project:
fe-ut:
target: 60%
threshold: 5%
only_pulls: true
patch:
fe-ut:
target: 80%
only_pulls: true