Skip to content

Commit

Permalink
Merge pull request #24 from Bernardo-MG/develop
Browse files Browse the repository at this point in the history
Develop
  • Loading branch information
Bernardo-MG authored Mar 29, 2021
2 parents ceb0763 + e2fb8c8 commit b3f4d6b
Show file tree
Hide file tree
Showing 12 changed files with 118 additions and 97 deletions.
31 changes: 31 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Deployment

on:
push:
branches:
- master

jobs:
deploy_docs:

runs-on: ubuntu-latest

steps:
- name: Check-out
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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
- name: Build distribution
run: python setup.py sdist bdist_wheel
- name: Deploy
run: twine upload -r pypi dist/*
env:
TWINE_USERNAME: ${{ secrets.DEPLOY_USER }}
TWINE_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
45 changes: 45 additions & 0 deletions .github/workflows/deploy_docs.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Doc deployment

on:
push:
branches:
- develop
- master

jobs:
deploy_docs:

runs-on: ubuntu-latest

steps:
- name: Extract branch name
shell: bash
run: echo "##[set-output name=branch;]$(echo ${GITHUB_REF#refs/heads/})"
id: extract_branch
- name: Check-out
uses: actions/checkout@v2
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.9
- 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
- name: Install sshpass
run: sudo apt-get install sshpass
- name: Tests docs
run: python setup.py test -p docs
- name: Build docs
run: python setup.py build_docs
- name: Deploy development docs
if: steps.extract_branch.outputs.branch == 'develop'
run: |
cd ./build/sphinx/html
sshpass -p "${{ secrets.DEPLOY_DOCS_DEVELOP_PASSWORD }}" scp -o 'StrictHostKeyChecking no' -P "${{ secrets.DEPLOY_DOCS_PORT }}" -r ./* "${{ secrets.DEPLOY_DOCS_DEVELOP_USER }}@${{ secrets.DEPLOY_DOCS_HOST }}:${{ secrets.DEPLOY_DOCS_DEVELOP_PATH }}";
- name: Deploy release docs
if: steps.extract_branch.outputs.branch == 'master'
run: |
cd ./build/sphinx/html
sshpass -p "${{ secrets.DEPLOY_DOCS_PASSWORD }}" scp -o 'StrictHostKeyChecking no' -P "${{ secrets.DEPLOY_DOCS_PORT }}" -r ./* "${{ secrets.DEPLOY_DOCS_USER }}@${{ secrets.DEPLOY_DOCS_HOST }}:${{ secrets.DEPLOY_DOCS_PATH }}";
26 changes: 26 additions & 0 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Testing and validation

on: [push, pull_request]

jobs:
test:

runs-on: ubuntu-latest
strategy:
matrix:
python-version: [3.6, 3.7, 3.8, 3.9]

steps:
- name: Check-out
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
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run all tests
run: python setup.py test -p py${{ matrix.python-version }}
42 changes: 0 additions & 42 deletions .travis.yml

This file was deleted.

2 changes: 1 addition & 1 deletion LICENSE
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
The MIT License (MIT)

Copyright (c) 2016-2018 Bernardo Martínez Garrido
Copyright (c) 2016-2021 Bernardo Martínez Garrido

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
Expand Down
4 changes: 2 additions & 2 deletions dice_notation/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,9 @@
Dice Notation Tools for Python
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Dice notation tools
:copyright: (c) 2016-2018 by Bernardo Martínez Garrido
:copyright: (c) 2016-2021 by Bernardo Martínez Garrido
:license: MIT, see LICENSE for more details.
"""

__version__ = '1.1.1'
__version__ = '1.2.0'
__license__ = 'MIT'
7 changes: 3 additions & 4 deletions docs/source/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -105,8 +105,8 @@
'years': '2016-%s' % datetime.datetime.now().year,
'scm_name': 'Github',
'scm_url': 'https://github.com/Bernardo-MG/dice-notation-python',
'ci_name': 'Travis',
'ci_url': 'https://travis-ci.org/Bernardo-MG/dice-notation-python',
'ci_name': 'Github',
'ci_url': 'https://github.com/Bernardo-MG/dice-notation-python/actions',
'issues_name': 'Github',
'issues_url': 'https://github.com/Bernardo-MG/dice-notation-python/issues',
'releases_repos': [
Expand All @@ -120,8 +120,7 @@
('Grammar', './docs/grammar.html'),
('Notation', './docs/notation.html'),
('Parser', './docs/parser.html')]),
('Info and Reports', [('Reports', './reports.html'),
('Code docs', './code/index.html')])],
('Info and Reports', [('Code docs', './code/index.html')])],
}

# Output file base name for HTML help builder.
Expand Down
1 change: 0 additions & 1 deletion docs/source/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,6 @@ Features

acquire
usage
reports
code/index
docs/dice
docs/grammar
Expand Down
26 changes: 0 additions & 26 deletions docs/source/reports.rst

This file was deleted.

13 changes: 7 additions & 6 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
# Installation and deployment
setuptools==46.1.1
twine==3.1.1
setuptools==54.2.0
wheel==0.36.2
twine==3.4.1
bernardomg.tox-test-command==1.1.6
bernardomg.version-extractor==1.0.3

# Testing
tox==3.14.5
tox==3.23.0

# Documentation
Sphinx==2.4.4
sphinx-docs-theme==1.0.3
Pygments==2.6.1
Sphinx==3.5.3
sphinx-docs-theme==1.0.7
Pygments==2.8.1

# Parsing
antlr4-python3-runtime==4.7.2
1 change: 1 addition & 0 deletions setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@ def read(*names, **kwargs):
'Programming Language :: Python :: 3.6',
'Programming Language :: Python :: 3.7',
'Programming Language :: Python :: 3.8',
'Programming Language :: Python :: 3.9'
'Topic :: Games/Entertainment :: Role-Playing'
],
long_description=read('README.rst'),
Expand Down
17 changes: 2 additions & 15 deletions tox.ini
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
[tox]
envlist =
py{36,37,38},
py{3.6,3.7,3.8,3.9},
check,
docs,
coverage
docs
skip_missing_interpreters =
true

Expand All @@ -15,18 +14,6 @@ deps =
commands =
nosetests

[testenv:coverage]
# Generates coverage report
passenv = TRAVIS TRAVIS_JOB_ID TRAVIS_BRANCH
deps =
-r{toxinidir}/requirements.txt
nose
coverage
coveralls
commands =
nosetests --with-coverage --cover-package=dice_notation
coveralls

[testenv:check]
# Checks code rules
deps =
Expand Down

0 comments on commit b3f4d6b

Please sign in to comment.