diff --git a/.codecov.yml b/.codecov.yml new file mode 100644 index 00000000..5cd767e7 --- /dev/null +++ b/.codecov.yml @@ -0,0 +1,8 @@ +coverage: + status: + patch: + default: + target: '100' + project: + default: + target: '88' diff --git a/.coveragerc b/.coveragerc new file mode 100644 index 00000000..ec099a5b --- /dev/null +++ b/.coveragerc @@ -0,0 +1,7 @@ +[run] +source = + smithy_python + +[report] +exclude_lines = + raise NotImplementedError diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 00000000..8ed1fed8 --- /dev/null +++ b/.github/workflows/ci.yml @@ -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 diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 00000000..0c2220ba --- /dev/null +++ b/.github/workflows/lint.yml @@ -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 diff --git a/.github/workflows/typecheck.yml b/.github/workflows/typecheck.yml new file mode 100644 index 00000000..51707ee8 --- /dev/null +++ b/.github/workflows/typecheck.yml @@ -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 diff --git a/tests/__init__.py b/tests/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/functional/__init__.py b/tests/functional/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/__init__.py b/tests/unit/__init__.py new file mode 100644 index 00000000..e69de29b diff --git a/tests/unit/test_dummy.py b/tests/unit/test_dummy.py new file mode 100644 index 00000000..aa26c78a --- /dev/null +++ b/tests/unit/test_dummy.py @@ -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) diff --git a/tox.ini b/tox.ini new file mode 100644 index 00000000..16181bff --- /dev/null +++ b/tox.ini @@ -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