From 9290864cbb0a79ac20ae7b7ceeef4211ee26f946 Mon Sep 17 00:00:00 2001 From: Aaron Madison Date: Tue, 17 Sep 2024 05:32:59 -0500 Subject: [PATCH 1/5] Peripheral: Adding Github actions --- .github/workflows/acceptance.yml | 31 ++++++++++++++++++++++++++++ .github/workflows/python-publish.yml | 31 ++++++++++++++++++++++++++++ 2 files changed, 62 insertions(+) create mode 100644 .github/workflows/acceptance.yml create mode 100644 .github/workflows/python-publish.yml diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml new file mode 100644 index 0000000..eb6309f --- /dev/null +++ b/.github/workflows/acceptance.yml @@ -0,0 +1,31 @@ +name: Acceptance CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + strategy: + max-parallel: 4 + matrix: + python-version: ['2.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + + steps: + - uses: actions/checkout@v4 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v5 + with: + python-version: ${{ matrix.python-version }} + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install mock flake8 + + - name: Run Tests + run: | + python -m unittest test.py diff --git a/.github/workflows/python-publish.yml b/.github/workflows/python-publish.yml new file mode 100644 index 0000000..7f407bd --- /dev/null +++ b/.github/workflows/python-publish.yml @@ -0,0 +1,31 @@ +# This workflow will upload a Python Package using Twine when a release is created +# For more information see: https://help.github.com/en/actions/language-and-framework-guides/using-python-with-github-actions#publishing-to-package-registries + +name: Upload Python Package + +on: + release: + types: [created] + +jobs: + deploy: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Set up Python + uses: actions/setup-python@v2 + with: + python-version: '3.x' + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install setuptools wheel twine + - name: Build and publish + env: + TWINE_USERNAME: ${{ secrets.PYPI_USERNAME_PUBLIC }} + TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_PUBLIC }} + run: | + python setup.py sdist bdist_wheel + twine upload dist/* From 1cc95a28893f53e54d18b7c8ea7de01fa61ef3a0 Mon Sep 17 00:00:00 2001 From: Aaron Madison Date: Tue, 17 Sep 2024 05:41:17 -0500 Subject: [PATCH 2/5] Peripheral: trying to test python 2.7 --- .github/workflows/27acceptance.yml | 24 ++++++++++++++++++++++++ .github/workflows/acceptance.yml | 4 ++-- 2 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/27acceptance.yml diff --git a/.github/workflows/27acceptance.yml b/.github/workflows/27acceptance.yml new file mode 100644 index 0000000..02e307c --- /dev/null +++ b/.github/workflows/27acceptance.yml @@ -0,0 +1,24 @@ +name: Acceptance CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + runs-on: ubuntu-latest + container: + image: python:2.7.18-buster + + steps: + - uses: actions/checkout@v4 + - name: Install Dependencies + run: | + python -m pip install --upgrade pip + pip install mock + + - name: Run Tests + run: | + python -m unittest test.py diff --git a/.github/workflows/acceptance.yml b/.github/workflows/acceptance.yml index eb6309f..1074295 100644 --- a/.github/workflows/acceptance.yml +++ b/.github/workflows/acceptance.yml @@ -13,7 +13,7 @@ jobs: strategy: max-parallel: 4 matrix: - python-version: ['2.7', '3.8', '3.9', '3.10', '3.11', '3.12'] + python-version: ['3.8', '3.9', '3.10', '3.11', '3.12'] steps: - uses: actions/checkout@v4 @@ -24,7 +24,7 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install mock flake8 + pip install mock - name: Run Tests run: | From ac6736106f1c7da63efdb4da38481e6b9a953366 Mon Sep 17 00:00:00 2001 From: Aaron Madison Date: Tue, 17 Sep 2024 05:45:05 -0500 Subject: [PATCH 3/5] Peripheral: trying to test python 2.7 --- .github/workflows/27acceptance.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/27acceptance.yml b/.github/workflows/27acceptance.yml index 02e307c..f2cf2cc 100644 --- a/.github/workflows/27acceptance.yml +++ b/.github/workflows/27acceptance.yml @@ -1,4 +1,4 @@ -name: Acceptance CI +name: 2.7 Acceptance CI on: push: @@ -17,7 +17,7 @@ jobs: - name: Install Dependencies run: | python -m pip install --upgrade pip - pip install mock + pip install mock unittest2 - name: Run Tests run: | From dfb643cedafa8be0290aa927d7940383cb67f9a2 Mon Sep 17 00:00:00 2001 From: Aaron Madison Date: Tue, 17 Sep 2024 05:49:18 -0500 Subject: [PATCH 4/5] Peripheral: trying to test python 2.7 --- .github/workflows/27acceptance.yml | 2 +- test.py | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/27acceptance.yml b/.github/workflows/27acceptance.yml index f2cf2cc..99b3220 100644 --- a/.github/workflows/27acceptance.yml +++ b/.github/workflows/27acceptance.yml @@ -21,4 +21,4 @@ jobs: - name: Run Tests run: | - python -m unittest test.py + python -m test diff --git a/test.py b/test.py index facc62d..a08105d 100755 --- a/test.py +++ b/test.py @@ -89,6 +89,7 @@ "status" : "OK" }""" + class GeocodeErrorTests(unittest.TestCase): def test_geocode_error_string_representation_contains_error_and_query(self): From 407d90887efe773fdd0a9d925a6b31e648bf68b7 Mon Sep 17 00:00:00 2001 From: Aaron Madison Date: Tue, 17 Sep 2024 05:54:53 -0500 Subject: [PATCH 5/5] Peripheral: remove travis ci --- .travis.yml | 15 --------------- 1 file changed, 15 deletions(-) delete mode 100644 .travis.yml diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index b47a98b..0000000 --- a/.travis.yml +++ /dev/null @@ -1,15 +0,0 @@ -dist: xenial -language: python -python: - - "2.7" - - "3.4" - - "3.5" - - "3.6" - - "3.7" - -install: - - pip install mock coverage flake8 -script: - - coverage run test.py - - coverage report --show-missing - - flake8 ggeocoder.py