-
Notifications
You must be signed in to change notification settings - Fork 1
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 #29 from Bernardo-MG/release
Release
- Loading branch information
Showing
12 changed files
with
128 additions
and
104 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 |
---|---|---|
@@ -1,5 +1,4 @@ | ||
[report] | ||
omit = | ||
*/python?.?/* | ||
*/site-packages/nose/* | ||
*__init__* |
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
This file was deleted.
Oops, something went wrong.
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 |
---|---|---|
@@ -1,26 +1,80 @@ | ||
name: Testing and validation | ||
name: Tests and docs | ||
|
||
on: [push, pull_request] | ||
|
||
jobs: | ||
test: | ||
tests: | ||
name: Tests | ||
uses: Bernardo-MG/github-workflow/.github/workflows/python_testing.yml@develop | ||
|
||
setup_docs: | ||
name: Doc deployment preparation | ||
needs: tests | ||
outputs: | ||
branchName: ${{ steps.extract_branch.outputs.branchName }} | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
|
||
steps: | ||
- name: Install sshpass | ||
run: sudo apt-get install sshpass | ||
- name: Extract branch name | ||
uses: bernardo-mg/extract-branch-name-action@v1 | ||
id: extract_branch | ||
|
||
deploy_docs: | ||
name: Deploy development docs | ||
environment: deployment_site | ||
needs: setup_docs | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.setup_docs.outputs.branchName == 'master' }} | ||
steps: | ||
- name: Check-out | ||
uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: 3.9 | ||
cache: 'pip' | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: 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 docs | ||
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 }}; | ||
deploy_develop_docs: | ||
name: Deploy development docs | ||
environment: deployment_site | ||
needs: setup_docs | ||
runs-on: ubuntu-latest | ||
if: ${{ needs.setup_docs.outputs.branchName == 'develop' }} | ||
steps: | ||
- name: Check-out | ||
uses: actions/checkout@v2 | ||
- name: Set up Python ${{ matrix.python-version }} | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
python-version: 3.9 | ||
cache: 'pip' | ||
- name: Update pip | ||
run: python -m pip install --upgrade pip | ||
- name: Install dependencies | ||
run: 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 docs | ||
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 }} | ||
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 }}; |
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 |
---|---|---|
|
@@ -42,7 +42,6 @@ htmlcov/ | |
.tox/ | ||
.coverage | ||
.cache | ||
nosetests.xml | ||
coverage.xml | ||
|
||
# Translations | ||
|
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
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 |
---|---|---|
|
@@ -7,5 +7,5 @@ | |
:license: MIT, see LICENSE for more details. | ||
""" | ||
|
||
__version__ = '1.2.0' | ||
__version__ = '1.2.1' | ||
__license__ = 'MIT' |
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
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
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 |
---|---|---|
@@ -1,17 +1,17 @@ | ||
# Installation and deployment | ||
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 | ||
setuptools==59.6.0 | ||
wheel==0.37.1 | ||
twine==3.8.0 | ||
bernardomg.tox-test-command==1.2.0 | ||
bernardomg.version-extractor==1.1.0 | ||
|
||
# Testing | ||
tox==3.23.0 | ||
tox==3.24.5 | ||
|
||
# Documentation | ||
Sphinx==3.5.3 | ||
Sphinx==4.4.0 | ||
sphinx-docs-theme==1.0.7 | ||
Pygments==2.8.1 | ||
Pygments==2.11.2 | ||
|
||
# Parsing | ||
antlr4-python3-runtime==4.7.2 | ||
antlr4-python3-runtime==4.9.3 |
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,33 @@ | ||
# -*- coding: utf-8 -*- | ||
|
||
import sys | ||
import unittest | ||
|
||
from dice_notation.parser import DiceParser | ||
|
||
""" | ||
Dice parser tests for expressions only containing dice. | ||
""" | ||
|
||
__author__ = 'Bernardo Martínez Garrido' | ||
__license__ = 'MIT' | ||
|
||
|
||
class TestSimpleDice(unittest.TestCase): | ||
""" | ||
Tests that simple dice expressions can be parsed. | ||
""" | ||
|
||
def setUp(self): | ||
""" | ||
Initializes parser. | ||
""" | ||
self.parser = DiceParser() | ||
|
||
def test_minimalDice(self): | ||
""" | ||
Tests that the minimal dice can be rolled. | ||
""" | ||
result = self.parser.parse("1d1").roll() | ||
|
||
self.assertEqual(1, result) |
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