Pipeline: add github workflows (#1)

Tooling: add github actions

* Add github actions to run pytest / flake8 / black
* Use clickhouse:20.6 (tests fail with 21.x, 20.8)
* Keep black away from pypy
This commit is contained in:
Oliver Margetts 2021-07-28 21:43:21 +00:00 committed by GitHub
parent bdec4843ce
commit a36e69822b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 64 additions and 1 deletions

63
.github/workflows/python-package.yml vendored Normal file
View File

@ -0,0 +1,63 @@
# This workflow will install Python dependencies, run tests and lint with a variety of Python versions
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions
name: Python package
on:
push:
branches: [ develop ]
pull_request:
branches: [ develop ]
jobs:
lint:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
# Lint on smallest and largest active versions
python-version: [3.6, 3.9]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry install
- name: Lint with flake8
run: |
poetry run flake8 clickhouse_orm/
cd tests && poetry run flake8
- name: Check formatting with black
run: |
poetry run black --line-length 120 --check clickhouse_orm/ tests/
test:
runs-on: ubuntu-latest
services:
clickhouse:
image: yandex/clickhouse-server:20.6
ports:
- 8123:8123
strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8, 3.9, pypy3]
steps:
- uses: actions/checkout@v2
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install poetry
poetry install
- name: Test with pytest
run: |
poetry run pytest

View File

@ -40,7 +40,7 @@ flake8-bugbear = "^21.4.3"
pep8-naming = "^0.12.0"
pytest = "^6.2.4"
flake8-isort = "^4.0.0"
black = "^21.7b0"
black = {version = "^21.7b0", markers = "platform_python_implementation == 'CPython'"}
isort = "^5.9.2"
freezegun = "^1.1.0"