Skip to content

Commit

Permalink
update tox/ci to allow benchmarks
Browse files Browse the repository at this point in the history
and use pip caching
  • Loading branch information
axsk committed Jun 10, 2020
1 parent 14381ad commit bd96ec5
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 8 deletions.
24 changes: 17 additions & 7 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
@@ -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
6 changes: 5 additions & 1 deletion tox.ini
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit bd96ec5

Please sign in to comment.