Skip to content

Commit

Permalink
[Tool] Upload both BE/FE coverage of PR after merged (#29812)
Browse files Browse the repository at this point in the history
Signed-off-by: AndyZiYe <[email protected]>
  • Loading branch information
andyziye authored Aug 23, 2023
1 parent c007c58 commit cef4a0c
Show file tree
Hide file tree
Showing 5 changed files with 27 additions and 21 deletions.
29 changes: 11 additions & 18 deletions .github/workflows/ci-doc-checker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -87,24 +87,17 @@ jobs:
ignore: node_modules
version: 0.28.1

behavior-change-unset:
runs-on: ubuntu-latest
needs: add-doc-label
steps:
- name: Replace Pull Request Body
uses: ivangabriele/[email protected]
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:
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/[email protected]
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"
2 changes: 1 addition & 1 deletion .github/workflows/ci-merged.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/ci-pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -735,22 +735,31 @@ 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 }}
BRANCH: ${{ github.base_ref }}
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: |
Expand Down
3 changes: 3 additions & 0 deletions .github/workflows/ci-report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
1 change: 1 addition & 0 deletions codecov.yml
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
comment: false
codecov:
allow_coverage_offsets: true
max_report_age: off
github_checks:
annotations: false
coverage:
Expand Down

0 comments on commit cef4a0c

Please sign in to comment.