Skip to content

Commit

Permalink
Setup GitHub actions CI
Browse files Browse the repository at this point in the history
  • Loading branch information
joguSD committed Apr 1, 2021
1 parent acf828c commit e81dceb
Show file tree
Hide file tree
Showing 10 changed files with 142 additions and 0 deletions.
8 changes: 8 additions & 0 deletions .codecov.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
coverage:
status:
patch:
default:
target: '100'
project:
default:
target: '88'
7 changes: 7 additions & 0 deletions .coveragerc
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
[run]
source =
smithy_python

[report]
exclude_lines =
raise NotImplementedError
40 changes: 40 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CI

on:
push:
branches: develop
pull_request:
branches: develop

jobs:
test:
runs-on: ubuntu-latest

strategy:
fail-fast: false
matrix:
python-version: [3.6, 3.7, 3.8]

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set Up Python - ${{ matrix.python-version }}
uses: actions/setup-python@v1
with:
python-version: ${{ matrix.python-version }}
- name: Install tox
run: |
python${{ matrix.python-version }} -m pip install --upgrade tox
- name: Run tests
run: |
tox -e py
- name: Upload coverage
if: matrix.python-version == 3.7
uses: codecov/codecov-action@v1
with:
token: ${{ secrets.CODECOV_TOKEN }}
file: ./coverage.xml
flags: unittests
name: codecov-umbrella
yml: ./codecov.yml
fail_ci_if_error: true
25 changes: 25 additions & 0 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Lint

on:
push:
branches: develop
pull_request:
branches: develop

jobs:
black-and-flake8:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set Up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install tox
run: |
python3.7 -m pip install tox
- name: Run linting
run: |
tox -e lint
25 changes: 25 additions & 0 deletions .github/workflows/typecheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
name: Type Check

on:
push:
branches: develop
pull_request:
branches: develop

jobs:
mypy:
runs-on: ubuntu-latest

steps:
- name: Checkout Repository
uses: actions/checkout@v1
- name: Set Up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install tox
run: |
python3.7 -m pip install tox
- name: Run type checks
run: |
tox -e type
Empty file added tests/__init__.py
Empty file.
Empty file added tests/functional/__init__.py
Empty file.
Empty file added tests/unit/__init__.py
Empty file.
6 changes: 6 additions & 0 deletions tests/unit/test_dummy.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import smithy_python


def test_version():
# TODO: Remove me when there's a real test
assert isinstance(smithy_python.__version__, str)
31 changes: 31 additions & 0 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
[tox]
envlist = py36,py37,py38

skipsdist = True

[testenv]
deps =
-r requirements-dev.txt
-e .
commands =
pytest --cov-config=.coveragerc --cov=./ --cov-report=xml tests/functional tests/unit

[testenv:lint]
deps =
-r requirements-dev.txt
commands =
black --check --diff smithy_python tests
flake8 smithy_python

[testenv:type]
deps =
-r requirements-dev.txt
commands =
mypy smithy_python --strict

[testenv:full_tests]
deps =
-r requirements-dev.txt
-e .
commands =
pytest --cov-config=.coveragerc --cov=./ --cov-report=xml tests

0 comments on commit e81dceb

Please sign in to comment.