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

Feat/migrate to gh actions #53

Merged
merged 10 commits into from
Nov 17, 2020
Merged
Show file tree
Hide file tree
Changes from 9 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
# 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 }}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Does this work to set up both version of Python?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes, it looks at the "strategy:matrix:python-version" field under Build and then creates separate workflows for each one.

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)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will this send a Slack notification if any tests fail?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I had actually forgotten to put the slack config in so thanks for catching that.

This will notify us in slack anytime the master build fails (due to failed tests, failed coverage upload, or anything else)

verbose: true
53 changes: 53 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -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
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