-
-
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.
* catalyst's hydra slayer added * tests added * codestyle added; `setup.py` updated * github actions added * setup.cfg - redundant fields removed * setup.py replaced with poetry * docs added * add docs versioning * upd actions * fix: codestyle
- Loading branch information
Showing
31 changed files
with
2,248 additions
and
127 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,90 @@ | ||
name: codestyle | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
|
||
jobs: | ||
|
||
catalyst-check-codestyle: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
fail-fast: false | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install -U pip | ||
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry run pip install -U pip | ||
poetry install | ||
- name: check codestyle | ||
run: | | ||
# TODO: poetry run catalyst-check-codestyle | ||
poetry run doc8 -q --file-encoding utf-8 -- docs | ||
# reviewdog: | ||
# runs-on: ubuntu-latest | ||
# strategy: | ||
# fail-fast: false | ||
# matrix: | ||
# python-version: [3.6] | ||
# env: | ||
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true | ||
|
||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: ${{ matrix.python-version }} | ||
|
||
# - name: Install poetry | ||
# run: | | ||
# pip install -U pip | ||
# curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
# echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
# - name: Set up cache | ||
# uses: actions/cache@v2 | ||
# with: | ||
# path: .venv | ||
# key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
# - name: Install dependencies | ||
# run: | | ||
# poetry config virtualenvs.in-project true | ||
# poetry run pip install -U pip | ||
# poetry install | ||
|
||
# - name: install reviewdog | ||
# run: | | ||
# mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin | ||
# echo ::add-path::$HOME/bin | ||
|
||
# - name: Run reviewdog | ||
# env: | ||
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
# run: | | ||
# flake8 . | reviewdog -f=pep8 -reporter=github-pr-review |
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,100 @@ | ||
name: deploy-on-release | ||
|
||
on: | ||
release: | ||
types: [published] | ||
|
||
jobs: | ||
|
||
build-pypi: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install -U pip | ||
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry run pip install -U pip | ||
poetry install | ||
- name: Generating distribution archives | ||
run: | | ||
poetry build | ||
- name: Publish a Python distribution to PyPI | ||
run: | | ||
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }} | ||
poetry publish | ||
build-docs: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install -U pip | ||
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry run pip install -U pip | ||
poetry install | ||
- name: make docs | ||
run: | | ||
rm -rf builds | ||
git fetch --all --tags | ||
poetry run sphinx-multiversion docs/ builds/ | ||
- name: commit documentation changes | ||
env: | ||
TAG: "${{ github.event.release.tag_name }}" | ||
run: | | ||
git clone https://github.com/catalyst-team/hydra-slayer.git --branch gh-pages --single-branch gh-pages | ||
cd gh-pages | ||
\cp -a ../builds/* . | ||
# commit changes | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "${TAG:=master docs}" || true | ||
- name: push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages | ||
directory: gh-pages | ||
github_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,65 @@ | ||
name: deploy-docs-on-push | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
# any tags | ||
|
||
jobs: | ||
|
||
build-docs: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
python-version: [3.8] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install -U pip | ||
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry run pip install -U pip | ||
poetry install | ||
- name: make docs | ||
run: | | ||
rm -rf builds | ||
git fetch --all --tags | ||
poetry run sphinx-multiversion docs/ builds/ | ||
- name: commit documentation changes | ||
env: | ||
TAG: "${{ github.event.release.tag_name }}" | ||
run: | | ||
git clone https://github.com/catalyst-team/hydra-slayer.git --branch gh-pages --single-branch gh-pages | ||
cd gh-pages | ||
rm -rf master | ||
\cp -a ../builds/* . | ||
# commit changes | ||
git config --local user.email "[email protected]" | ||
git config --local user.name "GitHub Action" | ||
git add . | ||
git commit -m "${TAG:=master docs}" || true | ||
- name: push changes | ||
uses: ad-m/github-push-action@master | ||
with: | ||
branch: gh-pages | ||
directory: gh-pages | ||
github_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,60 @@ | ||
name: test | ||
|
||
on: | ||
push: | ||
branches: | ||
- master | ||
pull_request: | ||
branches: | ||
- develop | ||
- master | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ${{ matrix.os }} | ||
strategy: | ||
fail-fast: false | ||
max-parallel: 4 | ||
matrix: | ||
os: [ubuntu-18.04, ubuntu-latest] | ||
python-version: [3.6, 3.7, 3.8, 3.9] | ||
requirements: ['latest', 'minimal'] | ||
|
||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: ${{ matrix.python-version }} | ||
|
||
- name: Install poetry | ||
run: | | ||
pip install -U pip | ||
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python - | ||
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH | ||
- name: Set up cache | ||
uses: actions/cache@v2 | ||
with: | ||
path: .venv | ||
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }} | ||
- name: Install dependencies | ||
run: | | ||
poetry config virtualenvs.in-project true | ||
poetry run pip install -U pip | ||
poetry install | ||
- name: Install latest dependencies | ||
if: matrix.requirements == 'latest' | ||
run: | | ||
poetry update | ||
- name: Unit tests | ||
env: | ||
REQUIREMENTS: ${{ matrix.requirements }} | ||
run: | | ||
poetry run pytest . | ||
- name: Check dependencies compatibility | ||
run: | | ||
poetry run poetry check | ||
poetry run pip check |
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 @@ | ||
pull_request_rules: | ||
# removes reviews done by collaborators when the pull request is updated | ||
- name: remove outdated reviews | ||
conditions: | ||
- base=master | ||
actions: | ||
dismiss_reviews: | ||
|
||
# automatic merge for master when required CI passes | ||
- name: automatic merge for master when CI passes and 2 review | ||
conditions: | ||
- "#approved-reviews-by>=2" | ||
- label!=WIP | ||
actions: | ||
merge: | ||
method: squash | ||
|
||
# deletes the head branch of the pull request, that is the branch which hosts the commits | ||
- name: delete head branch after merge | ||
conditions: | ||
- merged | ||
actions: | ||
delete_head_branch: {} | ||
|
||
# ask author of PR to resolve conflict | ||
- name: ask to resolve conflict | ||
conditions: | ||
- conflict | ||
actions: | ||
comment: | ||
message: "This pull request is now in conflicts. @{{ author }}, could you fix it? 🙏" |
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 +1,6 @@ | ||
# Hydra Slayer | ||
|
||
Hydra Slayer is a 4th level spell in the School of Fire Magic. | ||
Depending of the level of expertise in fire magic, | ||
slayer spell increases attack of target troop by 8 against | ||
hydras, snakes (especially pythons), and other creatures. |
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,20 @@ | ||
# Minimal makefile for Sphinx documentation | ||
# | ||
|
||
# You can set these variables from the command line, and also | ||
# from the environment for the first two. | ||
SPHINXOPTS ?= | ||
SPHINXBUILD ?= sphinx-build | ||
SOURCEDIR = . | ||
BUILDDIR = build | ||
|
||
# Put it first so that "make" without argument is like "make help". | ||
help: | ||
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) | ||
|
||
.PHONY: help Makefile | ||
|
||
# Catch-all target: route all unknown targets to Sphinx using the new | ||
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS). | ||
%: Makefile | ||
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.