forked from IntelPython/dpnp
-
Notifications
You must be signed in to change notification settings - Fork 0
80 lines (72 loc) · 2.41 KB
/
generate_coverage.yaml
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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
name: Generate coverage data for dpnp
on:
pull_request:
push:
branches: [master]
jobs:
generate-coverage:
name: Generate coverage and push to Coveralls.io
runs-on: ubuntu-20.04
defaults:
run:
shell: bash -l {0}
env:
python-ver: '3.10'
CHANNELS: '-c dppy/label/dev -c intel -c conda-forge --override-channels'
steps:
- name: Cancel Previous Runs
uses: styfle/cancel-workflow-action@0.11.0
with:
access_token: ${{ github.token }}
- name: Checkout repo
uses: actions/checkout@v3.5.2
with:
fetch-depth: 0
- name: Setup miniconda
uses: conda-incubator/setup-miniconda@v2.2.0
with:
auto-update-conda: true
python-version: ${{ env.python-ver }}
miniconda-version: 'latest'
activate-environment: 'coverage'
- name: Install Lcov
run: |
sudo apt-get install lcov
- name: Install dpnp dependencies
run: |
conda install cython llvm cmake">=3.21" scikit-build ninja pytest pytest-cov coverage[toml] \
dpctl dpcpp_linux-64 sysroot_linux-64">=2.28" mkl-devel-dpcpp tbb-devel onedpl-devel ${{ env.CHANNELS }}
- name: Conda info
run: |
conda info
conda list
- name: Build dpnp with coverage
run: |
python scripts/gen_coverage.py --pytest-opts="--ignore tests/test_random.py"
- name: Install coverall dependencies
run: |
sudo gem install coveralls-lcov
pip install coveralls==3.2.0
- name: Upload coverage data to coveralls.io
run: |
echo "Processing pytest-coverage"
export DPNP_PYTEST_LCOV=$(find . -name dpnp_pytest.lcov)
coveralls-lcov -v -n $DPNP_PYTEST_LCOV > pytest-dpnp-c-api-coverage.json
# merge file with coverage data and upload
echo "Merging files with coverage data"
coveralls --service=github --merge=pytest-dpnp-c-api-coverage.json
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
COVERALLS_PARALLEL: true
coveralls:
name: Indicate completion to coveralls.io
needs: generate-coverage
runs-on: ubuntu-latest
container: python:3-slim
steps:
- name: Finished
run: |
pip3 install --upgrade coveralls
coveralls --finish
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}