Upload coverage #2098
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
name: Upload coverage | |
permissions: read-all | |
on: | |
workflow_run: | |
workflows: ["Pre-Merge Checks"] | |
types: | |
- completed | |
jobs: | |
Upload-Coverage: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download artifact | |
uses: actions/download-artifact@v4 | |
with: | |
name: ${{ github.event.workflow_run.artifact_url }} | |
path: coverage | |
- name: Upload coverage report | |
run: | | |
COMMIT_ID=${{ github.event.workflow_run.head_sha }} | |
# Pass token from secrets if available. Otherwise it takes it from the environment variable of the CI | |
curl -Os https://uploader.codecov.io/latest/linux/codecov | |
chmod +x codecov | |
if [ -n "${{ secrets.CODECOV_TOKEN }}" ] | |
then | |
./codecov -t ${{ secrets.CODECOV_TOKEN }} --sha $COMMIT_ID -U $HTTP_PROXY -f coverage/coverage.xml | |
else | |
./codecov -t "${CODECOV_TOKEN}" --sha $COMMIT_ID -U $HTTP_PROXY -f coverage/coverage.xml | |
fi |