From 1e2156ecdbd5d659e91332c9d67a832cee144a28 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Wed, 30 Sep 2020 23:07:45 -0400 Subject: [PATCH 1/3] Add CI for PRs and CD for default branch --- .github/workflows/ci.yaml | 41 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 41 insertions(+) create mode 100644 .github/workflows/ci.yaml diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..9861e50 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,41 @@ +--- +name: CI +on: + pull_request: + types: ["opened", "synchronize"] + push: + branches: ["devel"] +jobs: + Test: + runs-on: ubuntu-latest + strategy: + matrix: + python: + - version: 3.6 + toxenv: py36 + - version: 3.7 + toxenv: py37 + - version: 3.8 + toxenv: py38 + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python.version }} + uses: actions/setup-python@v1 + with: + python-version: ${{ matrix.python.version }} + - name: Install tox + run: pip install "tox>=3.20.0,<3.21.0" --upgrade + - name: Run tests via ${{ matrix.python.toxenv }} + run: tox -e ${{ matrix.python.toxenv }} + Check: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v2 + - name: Set up Python 3.8 + uses: actions/setup-python@v1 + with: + python-version: 3.8 + - name: Install tox requirements + run: pip install "tox>=3.20.0,<3.21.0" --upgrade + - name: Run meta checks + run: tox -e static -e static-tests -e security From 4a1dc52755277b0e8c81479d8a2460184d7803ae Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Sun, 11 Oct 2020 18:57:33 -0400 Subject: [PATCH 2/3] Fix python version in pre-commit config --- .pre-commit-config.yaml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 9f1d389..5b395af 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -4,14 +4,14 @@ repos: rev: 20.8b1 hooks: - id: black - language_version: python3.7 + language_version: python3 - repo: https://github.com/asottile/blacken-docs rev: v0.5.0 hooks: - id: blacken-docs additional_dependencies: [black==20.8b1] - language_version: python3.7 + language_version: python3 - repo: https://github.com/asottile/reorder_python_imports rev: v2.3.5 From 7a34c47168b57802a2bf3413e1d3b407c8205d56 Mon Sep 17 00:00:00 2001 From: Ethan Paul <24588726+enpaul@users.noreply.github.com> Date: Sun, 11 Oct 2020 19:30:52 -0400 Subject: [PATCH 3/3] Wrap test checks in bash to avoid globbing errors --- tox.ini | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/tox.ini b/tox.ini index 45bed02..b89285d 100644 --- a/tox.ini +++ b/tox.ini @@ -45,8 +45,8 @@ allowlist_externals = commands = black {toxinidir}/tests/ bash -c "reorder-python-imports {toxinidir}/tests/*.py --unclassifiable-application-module tox_poetry_installer" - pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/ - mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/ + bash -c "pylint --rcfile {toxinidir}/.pylintrc {toxinidir}/tests/*.py" + bash -c "mypy --ignore-missing-imports --no-strict-optional {toxinidir}/tests/*.py" [testenv:security] description = Security checks