-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #1 from DontShaveTheYak/develop
v0.5 Initial public release
- Loading branch information
Showing
28 changed files
with
2,242 additions
and
2 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,112 @@ | ||
name: Build | ||
|
||
on: | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
paths: | ||
- '**.py' # Only run this workflow when python files change | ||
|
||
jobs: | ||
unit: | ||
name: Unit Tests | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8] | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch all history | ||
run: git fetch --prune --unshallow --tags | ||
|
||
- 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 | ||
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi | ||
pip install -e . | ||
- 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 --exit-zero --max-complexity=10 --max-line-length=127 --statistics | ||
- name: Run Unit Tests | ||
run: python -m unittest discover -s tests/unit | ||
|
||
functional: | ||
name: Functional Tests | ||
runs-on: ubuntu-latest | ||
if: github.base_ref == 'master' | ||
needs: unit | ||
env: | ||
GITHUB_SOURCE_BRANCH: ${{ github.head_ref }} | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.x | ||
|
||
- name: Configure AWS Credentials | ||
uses: aws-actions/configure-aws-credentials@v1 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | ||
aws-region: us-east-1 | ||
|
||
- name: Install dependencies | ||
run: pip install -r requirements.txt | ||
|
||
- name: Run Functional Tests | ||
run: python -m unittest discover -s tests/functional -f | ||
|
||
pypi: | ||
name: Test Pypi | ||
runs-on: ubuntu-latest | ||
if: github.base_ref == 'master' | ||
needs: unit | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Fetch all history | ||
run: git fetch --prune --unshallow --tags | ||
|
||
- 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: Calculate Next Version | ||
# id: next_version | ||
# uses: K-Phoen/semver-release-action@master | ||
# with: | ||
# release_branch: master | ||
# release_strategy: none | ||
# env: | ||
# GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Build and publish | ||
env: | ||
TWINE_USERNAME: ${{ secrets.PYPI_USERNAME }} | ||
TWINE_PASSWORD: ${{ secrets.PYPI_TEST_PASSWORD }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload --repository testpypi dist/* |
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,22 @@ | ||
name: Tag | ||
|
||
on: | ||
pull_request: | ||
types: closed | ||
|
||
jobs: | ||
tag: | ||
name: Create Tag | ||
runs-on: ubuntu-latest | ||
if: github.event.pull_request.merged && github.base_ref == 'master' | ||
steps: | ||
- name: Checkout Code | ||
uses: actions/checkout@master | ||
|
||
- name: Create Tag | ||
uses: K-Phoen/semver-release-action@master | ||
env: | ||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
with: | ||
release_branch: master | ||
release_strategy: tag |
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,44 @@ | ||
name: Release | ||
|
||
on: create | ||
|
||
jobs: | ||
release: | ||
name: Pypi | ||
runs-on: ubuntu-latest | ||
if: github.event.ref_type == 'tag' | ||
steps: | ||
- name: Checkout Code | ||
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 }} | ||
RELEASE_VERSION: ${{ github.event.ref }} | ||
run: | | ||
python setup.py sdist bdist_wheel | ||
twine upload dist/* | ||
- name: Create Github Release | ||
uses: Roang-zero1/github-create-release-action@master | ||
with: | ||
created_tag: ${{ github.event.ref }} | ||
|
||
- name: Update Release with Artifacts | ||
uses: ncipollo/[email protected] | ||
with: | ||
allowUpdates: true | ||
tag: ${{ github.event.ref }} | ||
artifacts: "dist/*" | ||
token: ${{ secrets.GITHUB_TOKEN }} |
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,102 @@ | ||
# Byte-compiled / optimized / DLL files | ||
__pycache__/ | ||
*.py[cod] | ||
*$py.class | ||
|
||
# C extensions | ||
*.so | ||
|
||
# Distribution / packaging | ||
.Python | ||
build/ | ||
develop-eggs/ | ||
dist/ | ||
downloads/ | ||
eggs/ | ||
.eggs/ | ||
lib/ | ||
lib64/ | ||
parts/ | ||
sdist/ | ||
var/ | ||
wheels/ | ||
*.egg-info/ | ||
.installed.cfg | ||
*.egg | ||
|
||
# PyInstaller | ||
# Usually these files are written by a python script from a template | ||
# before PyInstaller builds the exe, so as to inject date/other infos into it. | ||
*.manifest | ||
*.spec | ||
|
||
# Installer logs | ||
pip-log.txt | ||
pip-delete-this-directory.txt | ||
|
||
# Unit test / coverage reports | ||
htmlcov/ | ||
.tox/ | ||
.coverage | ||
.coverage.* | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
*.cover | ||
.hypothesis/ | ||
|
||
# Translations | ||
*.mo | ||
*.pot | ||
|
||
# Django stuff: | ||
*.log | ||
local_settings.py | ||
|
||
# Flask stuff: | ||
instance/ | ||
.webassets-cache | ||
|
||
# Scrapy stuff: | ||
.scrapy | ||
|
||
# Sphinx documentation | ||
docs/_build/ | ||
|
||
# PyBuilder | ||
target/ | ||
|
||
# Jupyter Notebook | ||
.ipynb_checkpoints | ||
|
||
# pyenv | ||
.python-version | ||
|
||
# celery beat schedule file | ||
celerybeat-schedule | ||
|
||
# SageMath parsed files | ||
*.sage.py | ||
|
||
# Environments | ||
.env | ||
.venv | ||
env/ | ||
venv/ | ||
ENV/ | ||
|
||
# Spyder project settings | ||
.spyderproject | ||
.spyproject | ||
|
||
# Rope project settings | ||
.ropeproject | ||
|
||
# mkdocs documentation | ||
/site | ||
|
||
# mypy | ||
.mypy_cache/ | ||
|
||
# vscode | ||
.vscode |
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,23 @@ | ||
# Changelog | ||
All notable changes to this project will be documented in this file. | ||
|
||
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), | ||
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html). | ||
|
||
Categories: | ||
- **Added** for new features. | ||
- **Changed** for changes in existing functionality. | ||
- **Deprecated** for soon-to-be removed features. | ||
- **Removed** for now removed features. | ||
- **Fixed** for any bug fixes. | ||
- **Security** in case of vulnerabilities. | ||
|
||
## [Unreleased] | ||
|
||
## [0.5.0] - 05/22/2020 | ||
### Added | ||
- Initial release with working functionality. | ||
|
||
|
||
[Unreleased]: https://github.com/DontShaveTheYak/sebs/compare/v0.5.0...develop | ||
[0.5.0]: https://github.com/DontShaveTheYak/sebs/releases/tag/v0.5.0 |
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,56 @@ | ||
## Setup | ||
|
||
To start contributing you will want to create a virtual environment for python3 in the root of the repo with | ||
the name `venv`. Once your virtual environment is activated, install the requirements. | ||
|
||
``` | ||
pip install -r requirements.txt | ||
``` | ||
|
||
## Running Tests | ||
|
||
### Unit | ||
|
||
To run unit tests you have severals options. We recommened you install our pre-commit hook which will run | ||
unit tests every time you commit a change. | ||
|
||
```BASH | ||
bash scripts/install-hooks.bash | ||
``` | ||
|
||
You can also run the tests by manually by using this script. | ||
|
||
```BASH | ||
./scripts/run-tests.bash | ||
``` | ||
|
||
Or by running the test command. | ||
|
||
```BASH | ||
python -m unittest discover -s tests/unit/ | ||
``` | ||
|
||
### Functional | ||
Functional tests will create and destroy resources on AWS. You do not have to run these localy if you | ||
don't want to. | ||
|
||
``` | ||
python -m unittest discover -s tests/functional/ -f -c | ||
``` | ||
|
||
Note: You need to push your changes upstream before you run the functional test as pip will clone down your current branch. | ||
|
||
|
||
### Linting | ||
|
||
We use autopep8 to format our files. If you have installed our pre-commit hook then autopep8 will | ||
run everytime you commit changes. | ||
|
||
You can also run our linting script. | ||
|
||
``` | ||
./scripts/run-list.bash | ||
``` | ||
|
||
Note: If files are found with issues then autopep8 will change those files for you. You will then have | ||
to stage those files again with git. |
Oops, something went wrong.