[Tool] Upload both BE/FE coverage of PR after merged (#29812)

Signed-off-by: AndyZiYe <yeziyu@starrocks.com>
This commit is contained in:
andyziye 2023-08-23 18:01:55 +08:00 committed by GitHub
parent c007c58209
commit cef4a0c0e0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
5 changed files with 27 additions and 21 deletions

View File

@ -87,24 +87,17 @@ jobs:
ignore: node_modules
version: 0.28.1
behavior-change-unset:
behavior-unchange:
runs-on: ubuntu-latest
needs: add-doc-label
env:
PR_NUMBER: ${{ github.event.number }}
REPO: ${{ github.repository }}
GITHUB_TOKEN: ${{ secrets.PAT }}
steps:
- name: Replace Pull Request Body
uses: ivangabriele/find-and-replace-pull-request-body@v1.1.5
with:
githubToken: ${{ secrets.PAT }}
find: '[x] Yes, this PR will result in a change in behavior.'
replace: '[ ] Yes, this PR will result in a change in behavior.'
behavior-unchange-set:
runs-on: ubuntu-latest
needs: add-doc-label
steps:
- name: Replace Pull Request Body
uses: ivangabriele/find-and-replace-pull-request-body@v1.1.5
with:
githubToken: ${{ secrets.PAT }}
find: '[ ] No, this PR will not result in a change in behavior.'
replace: '[x] No, this PR will not result in a change in behavior.'
- name: Set Body
run: |
body=$(gh pr view ${PR_NUMBER} -R ${REPO} --json body -q .body)
body=${body//"[x] Yes, this PR will result in a change in behavior."/"[ ] Yes, this PR will result in a change in behavior."}
body=${body//"[ ] No, this PR will not result in a change in behavior."/"[x] No, this PR will not result in a change in behavior."}
gh pr edit ${PR_NUMBER} -R ${REPO} -b "$body"

View File

@ -132,7 +132,7 @@ jobs:
- name: update merged coverage
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
GITHUB_TOKEN: ${{ secrets.PAT }}
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/upload_cov_after_merge.sh --pr ${PR_NUMBER} --commit ${{ steps.commit_sha.outputs.commit_sha }}

View File

@ -735,7 +735,7 @@ jobs:
Teardown:
runs-on: [self-hosted, normal]
name: Teardown
needs: [ deploy, admit ]
needs: [ deploy, SQL-Tester, admit ]
if: always() && needs.deploy.outputs.deploy_conf_file != ''
env:
PR_NUMBER: ${{ github.event.number }}
@ -743,14 +743,23 @@ jobs:
CONF_FILE: ${{ needs.deploy.outputs.deploy_conf_file }}
steps:
- name: Backup SR Info
id: backup
run: |
rm -rf ./ci-tool && cp -rf /var/lib/ci-tool ./ci-tool && cd ci-tool && git pull && source lib/init.sh
./bin/backup_log_cores.sh --branch $BRANCH --pr $PR_NUMBER --build Release --conf $CONF_FILE --repository ${{ github.repository }}
- name: Clean ECS
if: steps.backup.outcome == 'success'
env:
SQL_TESTER_RESULT: ${{ needs.SQL-Tester.outcome }}
ADMIT_RESULT: ${{ needs.admit.outcome }}
run: |
cd ci-tool && source lib/init.sh
./bin/elastic-cluster.sh --delete
if [[ "${SQL_TESTER_RESULT}" == 'success' && "${ADMIT_RESULT}" == 'success' ]]; then
./bin/elastic-cluster.sh --delete
else
./bin/elastic-cluster.sh --renew 0.25
fi
- name: Clean
run: |

View File

@ -31,6 +31,9 @@ jobs:
HEAD_SHA: ${{ steps.pr_details.outputs.HEAD_SHA }}
BASE_REF: ${{ steps.pr_details.outputs.BASE_REF }}
steps:
- run: |
sleep 30
- name: Download workflow artifact - PR
uses: dawidd6/action-download-artifact@v2
with:

View File

@ -1,6 +1,7 @@
comment: false
codecov:
allow_coverage_offsets: true
max_report_age: off
github_checks:
annotations: false
coverage: