-
Notifications
You must be signed in to change notification settings - Fork 1
76 lines (65 loc) · 1.88 KB
/
Copy pathquality-codecov.yml
File metadata and controls
76 lines (65 loc) · 1.88 KB
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
##
# @file
# Configuration file for code quality - Codecov.
#
# @copyright
# Copyright (c) 2023, Codevenience Organization. All rights reserved.<BR>
#
# SPDX-License-Identifier: BSD-3-Clause
#
# @par reference
# - https://docs.codecov.com/
#
##
name: 'Quality - Codecov'
on:
push:
branches:
- main
pull_request:
branches:
- '*'
jobs:
Codecov:
strategy:
matrix:
os: ['ubuntu-latest']
python-version: ['3.12']
runs-on: ${{ matrix.os }}
steps:
- name: Checkout the repository and commit
uses: actions/checkout@v3
with:
submodules: 'recursive'
fetch-depth: 0
- name: Setup Python environment
uses: actions/setup-python@v4
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
python -m pip install pytest
python -m pip install pytest-cov
- name: Generate coverage report (Comment)
if: github.event_name == 'pull_request'
run: |
PYTHONPATH=$PYTHONPATH:$(pwd)
export PYTHONPATH
pytest --cache-clear --cov=./ > pytest-coverage.txt
- name: Comment coverage
if: github.event_name == 'pull_request'
uses: coroo/pytest-coverage-commentator@v1.0.2
- name: Generate coverage report (HTML)
if: github.event_name == 'push'
run: |
PYTHONPATH=$PYTHONPATH:$(pwd)
export PYTHONPATH
pytest --cache-clear --cov=./ --cov-report=html
- name: Upload coverage to Codecov
if: github.event_name == 'push'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
fail_ci_if_error: true
verbose: true