-
Notifications
You must be signed in to change notification settings - Fork 179
63 lines (59 loc) · 2.57 KB
/
codecov.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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
#===============================================================================
# Copyright contributors to the oneDAL project
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
#===============================================================================
name: codecov
on:
workflow_run:
workflows: [CI]
types:
- completed
permissions: read-all
jobs:
upload_coverage:
name: Codecov
runs-on: ubuntu-24.04
if: ${{ github.repository == 'uxlfoundation/scikit-learn-intelex' && github.event.workflow_run.conclusion == 'success' }}
timeout-minutes: 5
steps:
- name: Checkout Scikit-learn-intelex
uses: actions/checkout@v4
- name: Download artifacts
uses: actions/download-artifact@v4
with:
path: coverage
github-token: ${{ github.token }}
run-id: ${{ github.event.workflow_run.id }}
merge-multiple: true
- name: Install codecov cli
run: |
curl -Os https://cli.codecov.io/latest/linux/codecov
chmod +x codecov
- name: Upload to codecov
run: |
# github's webhooks for workflow_run are unreliable, this guarantees to pull the PR number if a PR
OWNER="${FULL_NAME%/$NAME}"
if [ "${{ github.repository_owner }}" != "${OWNER}" ]; then BRANCH="${OWNER}:${BRANCH}"; fi
if [ $(git branch --show-current) != $BRANCH ]; then PR=$(gh pr view $BRANCH --json number -q .number); fi
echo uploading $BRANCH
SHA=${{ github.event.workflow_run.head_sha }}
VARARGS="-C ${SHA} -n github-${SHA}"
# if a PR, pass proper information to codecov-cli about the PR number
if [ -n "${PR}" ]; then VARARGS="${VARARGS}-${PR} -P ${PR}"; fi
./codecov -v upload-process -Z -t ${{ secrets.CODECOV_TOKEN }} $VARARGS -F github -s ./coverage
env:
GH_TOKEN: ${{ github.token }}
BRANCH: ${{ github.event.workflow_run.head_branch }}
NAME: ${{ github.event.workflow_run.head_repository.name }}
FULL_NAME: ${{ github.event.workflow_run.head_repository.full_name }}