From bd96ec5eb408c35481d6820780910c5b3d814ff7 Mon Sep 17 00:00:00 2001 From: axsk Date: Wed, 10 Jun 2020 21:33:10 +0200 Subject: [PATCH] update tox/ci to allow benchmarks and use pip caching --- .gitlab-ci.yml | 24 +++++++++++++++++------- tox.ini | 6 +++++- 2 files changed, 22 insertions(+), 8 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 8d20b03..d4421fb 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -1,21 +1,31 @@ image: "python:3.7" +variables: + PIP_CACHE_DIR: "$CI_PROJECT_DIR/.cache" + before_script: - - python --version - pip install flake8 - pip install tox -stages: - - Lint - - Test +cache: + key: one-key-to-rule-them-all + paths: + - .cache + - .tox -flake8: - stage: Lint +lint: allow_failure: true script: - flake8 pytest: - stage: Test script: - tox + artifacts: + reports: + junit: report.xml + +benchmark: + when: manual + script: + - tox -e benchmark -q diff --git a/tox.ini b/tox.ini index 9f2d33d..7ce267d 100644 --- a/tox.ini +++ b/tox.ini @@ -12,4 +12,8 @@ deps = pytest-cov pytest-benchmark commands = - pytest --cov=cmdtools --cov-report term-missing --benchmark-skip + pytest --cov=cmdtools --cov-report term-missing --benchmark-skip --junitxml=report.xml + +[testenv:benchmark] +commands = + pytest -W ignore::pytest_benchmark.logger.PytestBenchmarkWarning --benchmark-only