Skip to content

Commit 6284ca3

Browse files
author
Luca Valentini
authored
Improve CI with GitHub Actions (#1)
* Add type annotations * Add pytest-cov * Update CI * Add black banner to README * Disable Codecov
1 parent 2a91ed9 commit 6284ca3

File tree

5 files changed

+46
-19
lines changed

5 files changed

+46
-19
lines changed

.github/workflows/ci.yml

Lines changed: 20 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,34 +1,37 @@
1-
name: Python package
1+
name: Continuous integration
22

33
on: [push]
44

55
jobs:
66
build:
7-
87
runs-on: ubuntu-latest
9-
strategy:
10-
max-parallel: 3
11-
matrix:
12-
python-version: [3.7]
13-
148
steps:
15-
- uses: actions/checkout@v1
16-
- name: Set up Python ${{ matrix.python-version }}
9+
- name: Git checkout
10+
uses: actions/checkout@v1
11+
- name: Set up Python 3.7
1712
uses: actions/setup-python@v1
1813
with:
19-
python-version: ${{ matrix.python-version }}
14+
python-version: 3.7
2015
- name: Install dependencies
2116
run: |
2217
python -m pip install --upgrade pip poetry
2318
poetry install
2419
- name: Lint with flake8 and Black
2520
run: |
26-
pip install flake8
27-
# stop the build if there are Python syntax errors or undefined names
28-
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
29-
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide
30-
flake8 . --count --exit-zero --max-complexity=10 --max-line-length=127 --statistics
31-
black --check .
21+
poetry run flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics
22+
poetry run flake8 . --count --exit-zero --max-complexity=10 --max-line-length=88 --statistics
23+
poetry run black --check .
24+
poetry run mypy --ignore-missing-imports --disallow-untyped-defs .
25+
3226
- name: Test with pytest
3327
run: |
34-
pytest
28+
poetry run pytest --cov=./ --cov-report=xml
29+
- name: Upload coverage to Codecov
30+
run: echo "Codecov disabled"
31+
# NOTE: Disabled for now
32+
# uses: codecov/[email protected]
33+
# with:
34+
# token: ${{secrets.CODECOV_TOKEN}}
35+
# file: ./coverage.xml
36+
# flags: unittests
37+
# name: python-aws-ssm

README.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
# python-aws-ssm
2+
<a href="https://github.com/ambv/black"><img alt="Code style: black" src="https://img.shields.io/badge/code%20style-black-000000.svg"></a>
23
Python package that interfaces with AWS System Manager

poetry.lock

Lines changed: 23 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

pyproject.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ mypy = "^0.720.0"
2222
isort = "^4.3"
2323
black = "==19.3b0"
2424
flake8 = "^3.7"
25+
pytest-cov = "^2.7"
2526

2627
[build-system]
2728
requires = ["poetry>=0.12"]

python_aws_ssm/parameters.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,7 @@ def _tree_dict(key_list: List[Any], value: Optional[Any]) -> Dict[Any, Any]:
7676
return tree_dict
7777

7878
@staticmethod
79-
def _deep_merge(a, b):
79+
def _deep_merge(a: Union[Dict, Any], b: Union[Dict, Any]) -> Union[Dict, Any]:
8080
# NOTE: Thanks to: https://stackoverflow.com/a/56177639/9563578
8181
if not isinstance(a, dict) or not isinstance(b, dict):
8282
return a if b is None else b

0 commit comments

Comments
 (0)