Skip to content

Commit e81dceb

Browse files
committed
Setup GitHub actions CI
1 parent acf828c commit e81dceb

File tree

10 files changed

+142
-0
lines changed

10 files changed

+142
-0
lines changed

.codecov.yml

+8
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
coverage:
2+
status:
3+
patch:
4+
default:
5+
target: '100'
6+
project:
7+
default:
8+
target: '88'

.coveragerc

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
[run]
2+
source =
3+
smithy_python
4+
5+
[report]
6+
exclude_lines =
7+
raise NotImplementedError

.github/workflows/ci.yml

+40
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches: develop
6+
pull_request:
7+
branches: develop
8+
9+
jobs:
10+
test:
11+
runs-on: ubuntu-latest
12+
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
python-version: [3.6, 3.7, 3.8]
17+
18+
steps:
19+
- name: Checkout Repository
20+
uses: actions/checkout@v1
21+
- name: Set Up Python - ${{ matrix.python-version }}
22+
uses: actions/setup-python@v1
23+
with:
24+
python-version: ${{ matrix.python-version }}
25+
- name: Install tox
26+
run: |
27+
python${{ matrix.python-version }} -m pip install --upgrade tox
28+
- name: Run tests
29+
run: |
30+
tox -e py
31+
- name: Upload coverage
32+
if: matrix.python-version == 3.7
33+
uses: codecov/codecov-action@v1
34+
with:
35+
token: ${{ secrets.CODECOV_TOKEN }}
36+
file: ./coverage.xml
37+
flags: unittests
38+
name: codecov-umbrella
39+
yml: ./codecov.yml
40+
fail_ci_if_error: true

.github/workflows/lint.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Lint
2+
3+
on:
4+
push:
5+
branches: develop
6+
pull_request:
7+
branches: develop
8+
9+
jobs:
10+
black-and-flake8:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v1
16+
- name: Set Up Python 3.7
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.7
20+
- name: Install tox
21+
run: |
22+
python3.7 -m pip install tox
23+
- name: Run linting
24+
run: |
25+
tox -e lint

.github/workflows/typecheck.yml

+25
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
name: Type Check
2+
3+
on:
4+
push:
5+
branches: develop
6+
pull_request:
7+
branches: develop
8+
9+
jobs:
10+
mypy:
11+
runs-on: ubuntu-latest
12+
13+
steps:
14+
- name: Checkout Repository
15+
uses: actions/checkout@v1
16+
- name: Set Up Python 3.7
17+
uses: actions/setup-python@v1
18+
with:
19+
python-version: 3.7
20+
- name: Install tox
21+
run: |
22+
python3.7 -m pip install tox
23+
- name: Run type checks
24+
run: |
25+
tox -e type

tests/__init__.py

Whitespace-only changes.

tests/functional/__init__.py

Whitespace-only changes.

tests/unit/__init__.py

Whitespace-only changes.

tests/unit/test_dummy.py

+6
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
import smithy_python
2+
3+
4+
def test_version():
5+
# TODO: Remove me when there's a real test
6+
assert isinstance(smithy_python.__version__, str)

tox.ini

+31
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
[tox]
2+
envlist = py36,py37,py38
3+
4+
skipsdist = True
5+
6+
[testenv]
7+
deps =
8+
-r requirements-dev.txt
9+
-e .
10+
commands =
11+
pytest --cov-config=.coveragerc --cov=./ --cov-report=xml tests/functional tests/unit
12+
13+
[testenv:lint]
14+
deps =
15+
-r requirements-dev.txt
16+
commands =
17+
black --check --diff smithy_python tests
18+
flake8 smithy_python
19+
20+
[testenv:type]
21+
deps =
22+
-r requirements-dev.txt
23+
commands =
24+
mypy smithy_python --strict
25+
26+
[testenv:full_tests]
27+
deps =
28+
-r requirements-dev.txt
29+
-e .
30+
commands =
31+
pytest --cov-config=.coveragerc --cov=./ --cov-report=xml tests

0 commit comments

Comments
 (0)