-
-
Notifications
You must be signed in to change notification settings - Fork 48
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Version 2 of Splitwise - Added OAuth2 - Fixed Error handling - Added docs - Added tests - Added exceptions
- Loading branch information
1 parent
870348a
commit f0a09e9
Showing
50 changed files
with
4,073 additions
and
265 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
--- | ||
title: Release {{env.VERSION}} | ||
assignees: namaggarwal | ||
labels: ready-to-release | ||
--- | ||
|
||
A new version of Splitwise is ready to be released. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
name: End to End Tests | ||
|
||
on: | ||
pull_request: | ||
types: [opened, reopened] | ||
|
||
jobs: | ||
build: | ||
if: github.actor == 'namaggarwal' | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.7] | ||
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 flake8 pytest mock | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Install current package | ||
run: pip install . | ||
- name: Test with pytest | ||
env: | ||
CONSUMER_KEY: ${{ secrets.CONSUMER_KEY }} | ||
CONSUMER_SECRET: ${{ secrets.CONSUMER_KEY_SECRET }} | ||
OAUTH_TOKEN: ${{ secrets.OAUTH_TOKEN }} | ||
OAUTH_TOKEN_SECRET: ${{ secrets.OAUTH_TOKEN_SECRET }} | ||
run: | | ||
pytest e2e-tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
name: Lint and Test | ||
|
||
on: [push,pull_request] | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [2.7, 3.5, 3.6, 3.7, 3.8] | ||
|
||
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 flake8 pytest mock | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
- name: Lint with flake8 | ||
run: | | ||
# stop the build if there are Python syntax errors or undefined names | ||
flake8 . --count --select=E9,F63,F7,F82 --show-source --statistics | ||
# exit-zero treats all errors as warnings. The GitHub editor is 127 chars wide | ||
flake8 . --count --max-complexity=10 --statistics | ||
- name: Test with pytest | ||
run: | | ||
pytest tests |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,54 @@ | ||
name: Pre release package | ||
|
||
on: | ||
push: | ||
tags: | ||
- 'v*' | ||
jobs: | ||
release: | ||
name: Create Release | ||
runs-on: ubuntu-latest | ||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
- name: Create Release | ||
id: create_release | ||
uses: actions/create-release@v1 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} # This token is provided by Actions, you do not need to create your own token | ||
with: | ||
tag_name: ${{ github.ref }} | ||
release_name: Release ${{ github.ref }} | ||
body: | | ||
Changes in this Release | ||
draft: false | ||
prerelease: true | ||
deploy: | ||
needs: release | ||
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 }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload --repository testpypi dist/* | ||
- name: Create issue | ||
uses: JasonEtco/create-an-issue@v2 | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
VERSION: ${{ github.ref }} | ||
with: | ||
filename: .github/release-issue-template.md | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
name: Release to python pip | ||
|
||
on: | ||
issue_comment: | ||
types: [created] | ||
|
||
jobs: | ||
build: | ||
if: github.actor == 'namaggarwal' && startsWith(github.event.issue.title, 'Release ') && github.event.comment.body == 'release' | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions-ecosystem/action-regex-match@v2 | ||
id: check-release | ||
with: | ||
text: ${{ github.event.issue.title }} | ||
regex: '^Release refs/tags/(v\d\.\d\.\d)$' | ||
- name: Notify user starting the release | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: '+1' | ||
- name: Checkout version ${{ steps.check-release.outputs.group1 }} | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
uses: actions/checkout@v2 | ||
with: | ||
ref: ${{ steps.check-release.outputs.group1 }} | ||
- name: Set up Python | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.x' | ||
- name: Install dependencies | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
run: | | ||
python -m pip install --upgrade pip | ||
pip install setuptools wheel twine | ||
- name: Build and publish | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_PASSWORD_PRD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
- name: Notify user of successful release | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
uses: peter-evans/create-or-update-comment@v1 | ||
with: | ||
comment-id: ${{ github.event.comment.id }} | ||
reactions: hooray | ||
- name: Close Issue | ||
if: ${{ steps.check-release.outputs.group1 != ''}} | ||
uses: peter-evans/close-issue@v1 | ||
with: | ||
issue-number: ${{ github.event.issue.number }} | ||
comment: Release done | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -90,3 +90,5 @@ ENV/ | |
|
||
.DS_Store | ||
.pypirc | ||
.vscode | ||
/test.py |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.