From abe4b5745c0e8d3b1896f7c6390d9f4f16f67ff5 Mon Sep 17 00:00:00 2001 From: KevinMidboe Date: Tue, 18 Feb 2020 21:21:23 +0100 Subject: [PATCH] Py package: pytest-cov. Upload test coverage to codecov. --- .drone.yml | 28 +++++++++++++++++++--------- requirements.txt | 1 + 2 files changed, 20 insertions(+), 9 deletions(-) diff --git a/.drone.yml b/.drone.yml index 95efa8f..01c670c 100644 --- a/.drone.yml +++ b/.drone.yml @@ -11,22 +11,32 @@ steps: - name: test-python3.6 image: python:3.6-alpine commands: - - python --version - - pip install -r requirements.txt - - py.test test + - python --version + - pip install -r requirements.txt + - py.test test - name: test-python3.8 image: python:3.8-alpine commands: - - python --version - - pip install -r requirements.txt - - py.test test + - python --version + - pip install -r requirements.txt + - py.test test +- name: codecov + image: python3:6-alpine + environment: + CODECOV_TOKEN: + from_secret: CODECOV_TOKEN + commands: + - py.test --cov-report=xml --cov=src test + - pip install codecov + - codecov -t + trigger: branch: - - master + - master event: include: - - pull_request - - push + - pull_request + - push diff --git a/requirements.txt b/requirements.txt index 8e800f0..1450541 100644 --- a/requirements.txt +++ b/requirements.txt @@ -6,3 +6,4 @@ click>=6.7 langdetect>=1.0.7 titlecase>=0.12.0 pytest>=5.3.5 +pytest-cov>=2.8.1