Skip to content

Commit db4ca17

Browse files
authored
Setup CI (#108)
1 parent 567c4a5 commit db4ca17

File tree

4 files changed

+66
-32
lines changed

4 files changed

+66
-32
lines changed

.github/workflows/ci.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: build
2+
on:
3+
push:
4+
branches:
5+
- 'main'
6+
pull_request:
7+
8+
jobs:
9+
build:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python: [3.6, 3.7, 3.8, 3.9]
14+
django:
15+
- 'django>=3.2.0, <3.3'
16+
- 'django>=3.1.0, <3.2'
17+
- 'django>=3.0.0, <3.1'
18+
- 'django>=2.2.0, <3.0'
19+
- 'django>=2.1.0, <2.2.0'
20+
- 'django>=2.0.0, <2.1.0'
21+
steps:
22+
- uses: actions/checkout@v2
23+
- uses: actions/setup-python@v2
24+
with:
25+
python-version: ${{ matrix.python }}
26+
27+
- name: Add pip bin to PATH
28+
run: |
29+
echo "/home/runner/.local/bin" >> $GITHUB_PATH
30+
31+
- name: Install deps with ${{ matrix.python }}
32+
run: |
33+
pip install ".[test, ci]"
34+
pip install "${{ matrix.django }}" --upgrade
35+
36+
# ignore for now
37+
# - name: Lint with ${{ matrix.python }}
38+
# if: ${{ matrix.python == '3.8' }}
39+
# run: make lint
40+
41+
- name: Install, test and code coverage with ${{ matrix.python }}
42+
run: |
43+
python setup.py install
44+
make test

.travis.yml

Lines changed: 0 additions & 29 deletions
This file was deleted.

Makefile

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
STREAM_KEY ?= NOT_EXIST
2+
STREAM_SECRET ?= NOT_EXIST
3+
4+
.PHONY: help check test lint lint-fix
5+
6+
help: ## Display this help message
7+
@echo "Please use \`make <target>\` where <target> is one of"
8+
@grep -E '^[a-zA-Z_-]+:.*?## .*$$' $(MAKEFILE_LIST) | sort | awk 'BEGIN {FS = ":.*?## "}; \
9+
{printf "\033[36m%-40s\033[0m %s\n", $$1, $$2}'
10+
11+
lint: ## Run linters
12+
black --check stream
13+
flake8 --ignore=E501,E225,W293,W503,F401 stream_django
14+
15+
lint-fix:
16+
black stream_django
17+
18+
test: ## Run tests
19+
STREAM_KEY=$(STREAM_KEY) STREAM_SECRET=$(STREAM_SECRET) python setup.py test
20+
21+
check: lint test ## Run linters + tests

setup.py

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,9 +13,7 @@
1313

1414
requirements = [django, "stream-python>=3.0.1", "pytz"]
1515

16-
extras_require = {
17-
"test": ["httpretty==1.1.1"],
18-
}
16+
extras_require = {"test": ["httpretty==1.1.1"], "ci": ["black", "flake8", "pytest-cov"]}
1917

2018
setup(
2119
name="stream-django",

0 commit comments

Comments
 (0)