forked from openvinotoolkit/anomalib
-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (28 loc) · 998 Bytes
/
upload_coverage.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
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