Skip to content
This repository has been archived by the owner on Jan 12, 2024. It is now read-only.

Commit

Permalink
Feat/migrate to gh actions (#53)
Browse files Browse the repository at this point in the history
*Migrate to GH Actions
  • Loading branch information
tunderwood committed Nov 18, 2020
1 parent 4d774a5 commit 9a6dc42
Show file tree
Hide file tree
Showing 6 changed files with 107 additions and 31 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -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/[email protected]
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
51 changes: 51 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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 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: [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
run: |
twine upload -u ${{secrets.PYPI_USERNAME}} -p ${{secrets.PYPI_PASSWORD}} dist/*
- name: Slack notification when release fails
if: ${{ failure() }}
uses: rtCamp/[email protected]
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
27 changes: 0 additions & 27 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
2 changes: 1 addition & 1 deletion cerberus/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -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."""
Expand Down
1 change: 1 addition & 0 deletions requirements-dev.txt
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,5 @@ boto3
mock
nose
coverage
wheel
git+https://github.com/spulec/moto.git@5324638573e18e51b895b39ec0d32ac2133a37d0#egg=moto

0 comments on commit 9a6dc42

Please sign in to comment.