-
Notifications
You must be signed in to change notification settings - Fork 233
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add common test to GHA precommit workflow and upload coverage for it
- Loading branch information
Showing
3 changed files
with
76 additions
and
22 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,37 @@ | ||
name: Upload coverage from an artifact of a merged PR | ||
|
||
on: | ||
workflow_call: | ||
inputs: | ||
merge_commit_sha: | ||
required: true | ||
type: string | ||
last_sha_in_pr: | ||
required: true | ||
type: string | ||
coverage_artifact_name_in_pr: | ||
required: true | ||
type: string | ||
|
||
jobs: | ||
upload-coverage: | ||
if: github.event.pull_request.merged == true | ||
runs-on: ubuntu-20.04 | ||
steps: | ||
- uses: actions/checkout@v3 # codecov uploader demands that the scanned files be present when uploading | ||
with: | ||
ref: ${{ github.event.pull_request.merge_commit_sha }} | ||
- uses: dawidd6/action-download-artifact@v2 | ||
with: | ||
workflow: precommit.yml | ||
check_artifacts: true | ||
commit: ${{ github.event.pull_request.head.sha }} # this is the latest commit in the PR | ||
name: coverage_xml | ||
- name: Upload coverage report to Codecov | ||
run: | | ||
curl -Os https://uploader.codecov.io/latest/linux/codecov | ||
chmod +x codecov | ||
# github.event.pull_request.merge_commit_sha is the fresh commit in the develop, | ||
# provided that github.event.pull_request.merged == true | ||
./codecov -f ./coverage.xml -t ${{ secrets.CODECOV_TOKEN }} -C ${{ github.event.pull_request.merge_commit_sha }} -B develop -n "codecov-onnx" |