Skip to content

Commit cd05435

Browse files
authored
Adding codecov badge (unit8co#704)
* try adding codecov to develop workflow * add codecov badge to readme * try specifying coverage file * remove tests from coverage computation * produce coverage report in xml * add source to coveragerc file * Add codecov to merge workflow * remove coverage.sh
1 parent 299139c commit cd05435

File tree

6 files changed

+20
-21
lines changed

6 files changed

+20
-21
lines changed

.coveragerc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
[run]
2+
source=darts
3+
omit=darts/tests/*

.github/workflows/develop.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,13 @@ jobs:
5555
run: |
5656
./gradlew "test_${{matrix.flavour}}"
5757
58+
- name: "8. Codecov upload"
59+
if: ${{ matrix.flavour == 'all' }}
60+
uses: codecov/codecov-action@v2
61+
with:
62+
fail_ci_if_error: true
63+
files: ./coverage.xml
64+
5865
docs:
5966
runs-on: ubuntu-latest
6067
steps:

.github/workflows/merge.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,13 @@ jobs:
4848
run: |
4949
./gradlew "test_${{matrix.flavour}}"
5050
51+
- name: "7. Codecov upload"
52+
if: ${{ matrix.flavour == 'all' }}
53+
uses: codecov/codecov-action@v2
54+
with:
55+
fail_ci_if_error: true
56+
files: ./coverage.xml
57+
5158
check-examples:
5259
runs-on: ubuntu-latest
5360
strategy:

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
![GitHub Workflow Status](https://img.shields.io/github/workflow/status/unit8co/darts/darts%20release%20workflow/master)
1212
[![Downloads](https://pepy.tech/badge/u8darts)](https://pepy.tech/project/u8darts)
1313
[![Downloads](https://pepy.tech/badge/darts)](https://pepy.tech/project/darts)
14+
[![codecov](https://codecov.io/gh/unit8co/darts/branch/master/graph/badge.svg?token=7F1TLUFHQW)](https://codecov.io/gh/unit8co/darts)
1415

1516
**darts** is a Python library for easy manipulation and forecasting of time series.
1617
It contains a variety of models, from classics such as ARIMA to deep neural networks.

build.gradle

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -109,7 +109,7 @@ void createPipRelatedTask(String flavour) {
109109
dependsOn(taskArgument)
110110
dependsOn pip_core
111111
dependsOn pip_dev
112-
commandLine "pytest", "--durations=50", "--cov=darts", "darts/tests"
112+
commandLine "pytest", "--durations=50", "--cov=darts", "--cov-config=.coveragerc", "--cov-report=xml", "darts/tests"
113113
}
114114

115115
taskName = "test_" + flavour;
@@ -131,7 +131,7 @@ task unitTest_all(type: Exec) {
131131
doFirst {
132132
installPipLatest
133133
}
134-
commandLine "pytest", "--durations=50", "--cov=darts", "darts/tests"
134+
commandLine "pytest", "--durations=50", "--cov=darts", "--cov-config=.coveragerc", "--cov-report=xml", "darts/tests"
135135
}
136136

137137
task test_all() {

coverage.sh

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)