Skip to content

Commit

Permalink
Merge branch 'main' into fix_and_test_metric
Browse files Browse the repository at this point in the history
  • Loading branch information
qicosmos authored Nov 29, 2024
2 parents 2df1ea0 + eb587be commit db4874c
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 15 deletions.
11 changes: 0 additions & 11 deletions .github/actions/coverage/action.yml
Original file line number Diff line number Diff line change
Expand Up @@ -106,17 +106,6 @@ runs:
name: ${{ steps.get-cov-report.outputs.report }}
path: ${{ steps.get-cov-report.outputs.path }}

- name: 'Create code coverage report and comment'
run: |
if [ -n "${{ inputs.reset-commit-id }}" ];then
title="Base Code Coverage Report"
else
title="Current PR Code Coverage Report"
fi
content=$(echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts \`${{ steps.get-cov-report.outputs.report }}\`")
curl -L -X POST "https://api.github.com/repos/${{github.repository}}/issues/${{github.event.pull_request.number}}/comments" -H "Authorization: Bearer ${{github.token}}" -H 'Content-Type: application/json' -d "{\"body\": \"${title}\\n$content}\""
shell: bash

- name: 'Checkout source code'
uses: actions/checkout@v4
if: ${{ inputs.reset-commit-id }} != ""
10 changes: 6 additions & 4 deletions .github/workflows/linux_llvm_cov.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
name: Ubuntu 22.04 (llvm cov)

on:
pull_request:
pull_request_target:
branches:
- main
- fix_coverage_show
Expand All @@ -44,7 +44,6 @@ jobs:
base_commit_id=$(curl -s -H "Authorization: Bearer ${{ secrets.GITHUB_TOKEN }}" -H "Accept: application/vnd.github.v3+json" https://api.github.com/repos/${{ github.repository }}/pulls/${{ github.event.pull_request.number }} | jq -r .base.sha)
echo "::set-output name=id::$base_commit_id"
shell: bash
if: ${{ github.event_name == 'pull_request' }}

base-cov-test:
needs: prerequisites
Expand All @@ -63,7 +62,6 @@ jobs:
uses: ./.github/actions/coverage
with:
reset-commit-id: ${{ needs.prerequisites.outputs.id }}
if: ${{ github.event_name == 'pull_request' }}

cov-test:
needs: prerequisites
Expand All @@ -89,6 +87,11 @@ jobs:
- cov-test
runs-on: ubuntu-22.04
steps:
- name: 'Create comment'
run: |
content=$(echo "for detail, [goto summary](https://github.com/${{ github.repository_owner }}/${{ github.event.repository.name }}/actions/runs/${{github.run_id}}) download Artifacts \`base-ylt-cov-report\`(base commit coverage report) and \`ylt-cov-report\`(current pull request coverage report)")
curl -L -X POST "https://api.github.com/repos/${{github.repository}}/issues/${{github.event.pull_request.number}}/comments" -H "Authorization: Bearer ${{github.token}}" -H 'Content-Type: application/json' -d "{\"body\": \"$content}\""
shell: bash
- name: 'Compare data'
run: |
sudo apt install -y bc
Expand All @@ -103,4 +106,3 @@ jobs:
exit 1
fi
shell: bash
if: ${{ github.event_name == 'pull_request' }}

0 comments on commit db4874c

Please sign in to comment.