Skip to content

Commit

Permalink
run cov on prs (#11)
Browse files Browse the repository at this point in the history
  • Loading branch information
dimkouv authored Jul 1, 2024
1 parent a4e2427 commit 18f92cd
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions .github/workflows/ccip-ocr3-build-lint-test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,13 @@ jobs:
- name: Run tests
run: go test -race -fullpath -shuffle on -count 20 -coverprofile=coverage.out ./...
- name: Generate coverage report
if: github.event_name == 'pull_request'
run: |
go tool cover -func=coverage.out > coverage.txt
total=$(go tool cover -func=coverage.out | grep total | awk '{print $3}')
echo "coverage=$total" >> $GITHUB_ENV
- name: Coverage on target branch
if: github.event_name == 'pull_request'
run: |
git fetch origin ${{ github.base_ref }}
git checkout ${{ github.base_ref }}
Expand All @@ -47,6 +49,7 @@ jobs:
echo "coverage_target=$total" >> $GITHUB_ENV
- name: Remove previous coverage comments
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand All @@ -68,6 +71,7 @@ jobs:
}
- name: Display coverage in PR comment
uses: actions/github-script@v6
if: github.event_name == 'pull_request'
with:
github-token: ${{ secrets.GITHUB_TOKEN }}
script: |
Expand Down

0 comments on commit 18f92cd

Please sign in to comment.