Skip to content

Commit

Permalink
update workflow to upload coverage using action
Browse files Browse the repository at this point in the history
  • Loading branch information
yunchu committed Jul 20, 2023
1 parent 6cc44c9 commit bff11ec
Showing 1 changed file with 22 additions and 17 deletions.
39 changes: 22 additions & 17 deletions .github/workflows/pre_merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,24 +66,29 @@ jobs:
with:
name: coverage
path: .tox/coverage.xml
# - name: Upload coverage reports to Codecov
# run: |
# # If the workflow is triggered from PR then it gets the commit id from the PR.
# # else it uses the commit id of the latest commit. This is because the commit
# # of the checked-out branch/commit does not exist in the tree as it is grafted.
# # Also note: GitHub does not pass secrets to pipelines triggered from a fork.
# # This means that upload will fail for PRs from forks.
# if [ -n "${{ github.event.pull_request.head.sha }}" ]
# then
# COMMIT_ID=${{ github.event.pull_request.head.sha }}
# else
# COMMIT_ID=${{ github.sha }}
# fi
# # current version of codecov-action does not support uploading reports through the proxy
# # so we use the latest version of codecov uploader binary
# curl -Os https://uploader.codecov.io/latest/linux/codecov
# chmod +x codecov
# ./codecov -t ${{ secrets.CODECOV_TOKEN }} --sha $COMMIT_ID -U $HTTP_PROXY -f .tox/coverage.xml -F ${{ matrix.tox-env }}
- name: Upload coverage reports to Codecov
run: |
# If the workflow is triggered from PR then it gets the commit id from the PR.
# else it uses the commit id of the latest commit. This is because the commit
# of the checked-out branch/commit does not exist in the tree as it is grafted.
# Also note: GitHub does not pass secrets to pipelines triggered from a fork.
# This means that upload will fail for PRs from forks.
if [ -n "${{ github.event.pull_request.head.sha }}" ]
then
COMMIT_ID=${{ github.event.pull_request.head.sha }}
else
COMMIT_ID=${{ github.sha }}
fi
# current version of codecov-action does not support uploading reports through the proxy
# so we use the latest version of codecov uploader binary
curl -Os https://uploader.codecov.io/latest/linux/codecov
chmod +x codecov
./codecov -t ${{ secrets.CODECOV_TOKEN }} --sha $COMMIT_ID -U $HTTP_PROXY -f .tox/coverage.xml -F ${{ matrix.tox-env }}
uses: codecov/codecov-action@v3
with:
files: .tox/coverage.xml
flags: ${{ matrix.tox-env }}
Integration-Test:
needs: Unit-Test
strategy:
Expand Down

0 comments on commit bff11ec

Please sign in to comment.