From 796bb6ba4908148cba98234c385b23e024defb96 Mon Sep 17 00:00:00 2001 From: Dmitry Date: Mon, 23 Mar 2020 11:05:05 +0200 Subject: [PATCH] chore: updated circleci scripts #58 --- .circleci/config.yml | 6 +++--- apps/core/scripts/poetry_scripts.py | 9 +++++++++ pyproject.toml | 4 ++++ 3 files changed, 16 insertions(+), 3 deletions(-) create mode 100644 apps/core/scripts/poetry_scripts.py diff --git a/.circleci/config.yml b/.circleci/config.yml index a51f7c5..91141a1 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -52,7 +52,7 @@ jobs: - restore_cache: keys: - - v1-dependencies-{{ checksum "Pipfile.lock" }} + - v1-dependencies-{{ checksum "poetry.lock" }} # fallback to using the latest cache if no exact match is found - v1-dependencies- @@ -72,8 +72,8 @@ jobs: name: Run tests and create a Report command: | mkdir test-reports - coverage run -m py.test - coverage xml + poetry run create-coverage + poetry run codecov-report - save_cache: key: v1-dependencies-{{ checksum "poetry.lock" }} diff --git a/apps/core/scripts/poetry_scripts.py b/apps/core/scripts/poetry_scripts.py new file mode 100644 index 0000000..ea4e2d2 --- /dev/null +++ b/apps/core/scripts/poetry_scripts.py @@ -0,0 +1,9 @@ +import os + + +def coverage_report(): + os.system("coverage run -m py.test") + + +def coverage_xml(): + os.system("coverage xml") diff --git a/pyproject.toml b/pyproject.toml index 4ae1afe..f12dd1f 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -52,6 +52,10 @@ pytest-sugar = "^0.9.2" pytest-env = "^0.6.2" +[tool.poetry.scripts] +create-coverage = "apps.core.scripts:coverage_report" +codecov-report = "apps.core.scripts:coverage_xml" + [build-system] requires = ["poetry>=0.12"] build-backend = "poetry.masonry.api"