Skip to content

Commit d12e440

Browse files
[wip] wip on ci integration (#1)
* CI and coverage integration
1 parent 13cf849 commit d12e440

File tree

4 files changed

+118
-13
lines changed

4 files changed

+118
-13
lines changed

.github/workflows/poetry-pytest.yml

Lines changed: 32 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,17 +7,37 @@ jobs:
77
runs-on: ubuntu-latest
88
steps:
99
- uses: actions/checkout@master
10-
- name: Install
11-
uses: abatilo/actions-poetry@v1.5.0
10+
- name: Set up Python 3.7
11+
uses: actions/setup-python@v1
1212
with:
13-
python_version: 3.8.0
14-
poetry_version: 0.12.17
15-
working_directory: ./working_dir # Optional, defaults to '.'
16-
args: install
17-
- name: Run pytest
18-
uses: abatilo/[email protected]
13+
python-version: 3.7
14+
15+
- name: Install Poetry
16+
uses: dschep/[email protected]
17+
18+
- name: Cache Poetry virtualenv
19+
uses: actions/cache@v1
20+
id: cache
1921
with:
20-
python_version: 3.8.0
21-
poetry_version: 0.12.17
22-
working_directory: ./working_dir
23-
args: run python -m pytest --cov=redibench_admin --cov-branch --cov-fail-under=100 tests/
22+
path: ~/.virtualenvs
23+
key: poetry-${{ hashFiles('**/poetry.lock') }}
24+
restore-keys: |
25+
poetry-${{ hashFiles('**/poetry.lock') }}
26+
27+
- name: Set Poetry config
28+
run: |
29+
poetry config virtualenvs.in-project false
30+
poetry config virtualenvs.path ~/.virtualenvs
31+
32+
- name: Install Dependencies
33+
run: poetry install
34+
if: steps.cache.outputs.cache-hit != 'true'
35+
36+
- name: Test with pytest
37+
env:
38+
DJANGO_SETTINGS_MODULE: project.settings
39+
SECRETS_FILE: .confidential/ci.json
40+
run: poetry run pytest --cov redisbench_admin
41+
42+
- name: Upload coverage
43+
run: poetry run codecov -t ${{ secrets.CODECOV_TOKEN }}

README.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
[![codecov](https://codecov.io/gh/filipecosta90/redisbench-admin/branch/master/graph/badge.svg)](https://codecov.io/gh/filipecosta90/redisbench-admin)
2+
![Actions](https://github.com/filipecosta90/redisbench-admin/workflows/Run%20Tests/badge.svg?branch=master)
13

24
# redisbench-admin
35
Redis benchmark run helper. A wrapper around ftsb_redisearch ( future versions will also support redis-benchmark and memtier_benchmark ).

poetry.lock

Lines changed: 81 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ name = "redisbench-admin"
33
version = "0.1.6"
44
description = "Redis benchmark run helper. A wrapper around ftsb_redisearch ( future versions will also support redis-benchmark and memtier_benchmark )."
55
authors = ["filipecosta90 <[email protected]>"]
6+
readme = "README.md"
67

78
[tool.poetry.scripts]
89
redisbench-admin = "redisbench_admin.cli:main"
@@ -20,6 +21,8 @@ toml = "^0.10.1"
2021

2122
[tool.poetry.dev-dependencies]
2223
pytest = "^4.6"
24+
pytest-cov = "^2.9.0"
25+
codecov = "^2.1.4"
2326

2427
[build-system]
2528
requires = ["poetry>=0.12"]

0 commit comments

Comments
 (0)