diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 0000000..2dbc14b --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,51 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Build + +on: + push: + branches: + - '**' + pull_request: + branches: [ master ] + +jobs: + Build: + runs-on: ubuntu-18.04 + strategy: + matrix: + python-version: [2.7, 3.6] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install google-compute-engine + pip install twine + pip install -r requirements-dev.txt + python setup.py install + - name: Run Tests + run: | + nosetests --with-coverage --cover-xml tests/ + - name: Upload coverage report to CodeCov + uses: codecov/codecov-action@v1 + with: + file: coverage.xml # optional + fail_ci_if_error: true # optional (default = false) + verbose: true + - name: Slack notification when master build fails + if: ${{ failure() && github.ref == 'refs/heads/master'}} + uses: rtCamp/action-slack-notify@v2.1.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: cerberus-alerts + SLACK_MESSAGE: 'Cerberus main build has failed :build-failed:' + SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + SLACK_TITLE: Cerberus Build Failure Notification + SLACK_USERNAME: GitHub Actions diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml new file mode 100644 index 0000000..2549a42 --- /dev/null +++ b/.github/workflows/release.yml @@ -0,0 +1,53 @@ +# This workflow will install Python dependencies, run tests and lint with a variety of Python versions +# For more information see: https://help.github.com/actions/language-and-framework-guides/using-python-with-github-actions + +name: Build and Release + +on: + push: + # Sequence of patterns matched against refs/tags + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v2 + +jobs: + Build-And-Release: + runs-on: ubuntu-latest + strategy: + matrix: + python-version: [2.7, 3.6] + + steps: + - uses: actions/checkout@v2 + - name: Set up Python ${{ matrix.python-version }} + uses: actions/setup-python@v2 + with: + python-version: ${{ matrix.python-version }} + - name: Install dependencies + run: | + python -m pip install --upgrade pip + pip install google-compute-engine + pip install twine + pip install -r requirements-dev.txt + python setup.py install + - name: Run Tests + run: | + nosetests --verbosity=2 tests/ + - name: Prepare for release to PyPi + run: | + python setup.py sdist + python setup.py bdist_wheel --universal + - name: Publish a Python distribution to PyPI + uses: pypa/gh-action-pypi-publish@master + with: + user: ${{ secrets.PYIP_USERNAME }} + password: ${{ secrets.PYPI_PASSWORD }} + - name: Slack notification when release fails + if: ${{ failure() }} + uses: rtCamp/action-slack-notify@v2.1.0 + env: + SLACK_WEBHOOK: ${{ secrets.SLACK_WEBHOOK }} + SLACK_CHANNEL: cerberus-alerts + SLACK_MESSAGE: 'Cerberus release workflow has failed :build-failed:' + SLACK_ICON: https://github.githubassets.com/images/modules/logos_page/GitHub-Mark.png + SLACK_TITLE: Cerberus Build Failure Notification + SLACK_USERNAME: GitHub Actions diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index a54346a..0000000 --- a/.travis.yml +++ /dev/null @@ -1,27 +0,0 @@ -language: python -python: -- '2.7' -- '3.6' -install: -- pip install -r requirements-dev.txt -- pip install google-compute-engine -- pip install twine -- python setup.py install -script: -- nosetests --verbosity=2 tests/ -after_success: -- test "${TRAVIS_PULL_REQUEST}" == "false" && test "${TRAVIS_TAG}" != "" && python - setup.py sdist && python setup.py bdist_wheel --universal && twine -u ${USERNAME} - -p ${PASSWORD} -r https://pypi.python.org/pypi register dist/*.whl && twine upload - -u ${USERNAME} -p ${PASSWORD} -r https://pypi.python.org/pypi dist/*.tar.gz -env: - global: - - secure: TeTGvEJ56ZjN0f7SXFgH1pkmUShIiVsNNQyEIfKZy4Zk4swgQa++9Nel0YthM8D9whogTMS0Vfg60XXCeXx/p74xMlAmq1B3bNcC0IHYMneZRHu1V8ZGcJqbWBxg8oRuQqx/QgTLy2xQ42Q2LwK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W2TQ65k6Kdcq5ertHRON27sIu2MQoSM0qoSi7eWz8Qmb5ql9bnOFg+xY6QLE57oeBpzmDQXL3sGhZQwjSQERVpzMiswbI3JSodzYxbizLuiBrU5iDTvmjBeRae+l6nmM= -notifications: - slack: - if: branch = master AND (type = push OR type=cron) - on_success: change - on_failure: always - rooms: - - secure: lL7sg30YyDduAeBUP3izaQnyjcFqHoVWdy5fn6KkRIX3562m4viqP7IZ8g0pVHOoPi5r+C4Sc6Ybj6yGqM0/RPnQjJ4o68Vv8K7bS77DhKGt+AaVKXG+XrTYyhk2oFybCTV+YTAmMTkoLANdQBtBYCGhIOHWLH7gehWManXgX/KmCJGBi1SBqKpl9NeWHCJzwYS0goJ3kDh1MJa5ZO5K1qKYRWSiAYeUXATkjJphtNZUOXGbmx4RFzRibiTndonQw24riQw6ZTO5IPIObK7YVDZkRh/wFErdQfbkRpUfkP97HsgIdWfONBIB8vUIQ7Ju3oWhtWZ+2WOCoHARCTHZf4kzONJVaCnCfgZSLBDBEr8MVoVHm2tBn/iea/0whD36SaUXU84E9iLF1Sxc53CBdqin29lYlfIhvs/NmVYQ/pGOe0/BFIwegeILOb3pm2Ne+8k4pnYGl+hIJixhiiTDTR5As1IG/Bv0vOlttuoAvDyL+4QxOU6Jzdy+yf1MVqsGcrnfR/HpF7Y3ztqB7et8nlsdYV7GYQ6nI6SuOrXEpwsnlG2Do5iqfz14AuqH8zRkqosy8rURbjvItutqlvkrD7DV/eKRpe+KQDQwhOsdiLvgKltEG241WTOIu/7xTCXgj6+gh5cOAFR7XYmOMVtN39ZoBkLzy+Yzbr3sLmZMXOA= diff --git a/README.md b/README.md index 9a23dc3..bd242a5 100644 --- a/README.md +++ b/README.md @@ -1,7 +1,8 @@ # Cerberus Python Client -[![][travis img]][travis] +![Python package](https://github.com/Nike-Inc/cerberus-python-client/workflows/Build/badge.svg) [![][license img]][license] +[![codecov](https://codecov.io/gh/Nike-Inc/cerberus-python-client/branch/master/graph/badge.svg)](https://codecov.io/gh/Nike-Inc/cerberus-python-client) [![PyPI version](https://badge.fury.io/py/cerberus-python-client.svg)](https://badge.fury.io/py/cerberus-python-client) This is a Python based client library for communicating with Cerberus via HTTPS and enables authentication schemes specific @@ -379,8 +380,7 @@ Refer to the "local development" section at [Quick Start](http://engineering.nik Cerberus Management Service is released under the [Apache License, Version 2.0](http://www.apache.org/licenses/LICENSE-2.0) -[travis]:https://travis-ci.org/Nike-Inc/cerberus-python-client -[travis img]:https://api.travis-ci.org/Nike-Inc/cerberus-python-client.svg?branch=master +[gh actions img]:https://api.travis-ci.org/Nike-Inc/cerberus-python-client.svg?branch=master [license]:LICENSE.txt [license img]:https://img.shields.io/badge/License-Apache%202-blue.svg diff --git a/cerberus/__init__.py b/cerberus/__init__.py index e05099d..c3b8afc 100644 --- a/cerberus/__init__.py +++ b/cerberus/__init__.py @@ -3,7 +3,7 @@ __all__ = ['client', 'user_auth', 'aws_auth', 'util'] -CLIENT_VERSION = '2.5.0' +CLIENT_VERSION = '2.5.1' class CerberusClientException(Exception): """Wrap third-party exceptions expected by the Cerberus client."""