Skip to content

Commit 9691ca1

Browse files
authored
v0.1.0rc0 (#1)
* 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
1 parent db2532c commit 9691ca1

31 files changed

+2248
-127
lines changed

.github/workflows/codestyle.yml

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
name: codestyle
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- develop
10+
- master
11+
12+
jobs:
13+
14+
catalyst-check-codestyle:
15+
runs-on: ubuntu-latest
16+
strategy:
17+
fail-fast: false
18+
matrix:
19+
python-version: [3.8]
20+
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Set up Python
24+
uses: actions/setup-python@v2
25+
with:
26+
python-version: ${{ matrix.python-version }}
27+
28+
- name: Install poetry
29+
run: |
30+
pip install -U pip
31+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
32+
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
33+
- name: Set up cache
34+
uses: actions/cache@v2
35+
with:
36+
path: .venv
37+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
38+
- name: Install dependencies
39+
run: |
40+
poetry config virtualenvs.in-project true
41+
poetry run pip install -U pip
42+
poetry install
43+
44+
- name: check codestyle
45+
run: |
46+
# TODO: poetry run catalyst-check-codestyle
47+
poetry run doc8 -q --file-encoding utf-8 -- docs
48+
49+
# reviewdog:
50+
# runs-on: ubuntu-latest
51+
# strategy:
52+
# fail-fast: false
53+
# matrix:
54+
# python-version: [3.6]
55+
# env:
56+
# ACTIONS_ALLOW_UNSECURE_COMMANDS: true
57+
58+
# steps:
59+
# - uses: actions/checkout@v2
60+
# - name: Set up Python
61+
# uses: actions/setup-python@v2
62+
# with:
63+
# python-version: ${{ matrix.python-version }}
64+
65+
# - name: Install poetry
66+
# run: |
67+
# pip install -U pip
68+
# curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
69+
# echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
70+
# - name: Set up cache
71+
# uses: actions/cache@v2
72+
# with:
73+
# path: .venv
74+
# key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
75+
# - name: Install dependencies
76+
# run: |
77+
# poetry config virtualenvs.in-project true
78+
# poetry run pip install -U pip
79+
# poetry install
80+
81+
# - name: install reviewdog
82+
# run: |
83+
# mkdir -p $HOME/bin && curl -sfL https://raw.githubusercontent.com/reviewdog/reviewdog/master/install.sh| sh -s -- -b $HOME/bin
84+
# echo ::add-path::$HOME/bin
85+
86+
# - name: Run reviewdog
87+
# env:
88+
# REVIEWDOG_GITHUB_API_TOKEN: ${{ secrets.GITHUB_TOKEN }}
89+
# run: |
90+
# flake8 . | reviewdog -f=pep8 -reporter=github-pr-review
Lines changed: 100 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,100 @@
1+
name: deploy-on-release
2+
3+
on:
4+
release:
5+
types: [published]
6+
7+
jobs:
8+
9+
build-pypi:
10+
runs-on: ubuntu-latest
11+
strategy:
12+
matrix:
13+
python-version: [3.8]
14+
15+
steps:
16+
- uses: actions/checkout@v2
17+
- name: Set up Python
18+
uses: actions/setup-python@v2
19+
with:
20+
python-version: ${{ matrix.python-version }}
21+
22+
- name: Install poetry
23+
run: |
24+
pip install -U pip
25+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
26+
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
27+
- name: Set up cache
28+
uses: actions/cache@v2
29+
with:
30+
path: .venv
31+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
32+
- name: Install dependencies
33+
run: |
34+
poetry config virtualenvs.in-project true
35+
poetry run pip install -U pip
36+
poetry install
37+
38+
- name: Generating distribution archives
39+
run: |
40+
poetry build
41+
42+
- name: Publish a Python distribution to PyPI
43+
run: |
44+
poetry config pypi-token.pypi ${{ secrets.PYPI_TOKEN }}
45+
poetry publish
46+
47+
build-docs:
48+
runs-on: ubuntu-latest
49+
strategy:
50+
matrix:
51+
python-version: [3.8]
52+
53+
steps:
54+
- uses: actions/checkout@v2
55+
- name: Set up Python
56+
uses: actions/setup-python@v2
57+
with:
58+
python-version: ${{ matrix.python-version }}
59+
60+
- name: Install poetry
61+
run: |
62+
pip install -U pip
63+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
64+
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
65+
- name: Set up cache
66+
uses: actions/cache@v2
67+
with:
68+
path: .venv
69+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
70+
- name: Install dependencies
71+
run: |
72+
poetry config virtualenvs.in-project true
73+
poetry run pip install -U pip
74+
poetry install
75+
76+
- name: make docs
77+
run: |
78+
rm -rf builds
79+
git fetch --all --tags
80+
poetry run sphinx-multiversion docs/ builds/
81+
82+
- name: commit documentation changes
83+
env:
84+
TAG: "${{ github.event.release.tag_name }}"
85+
run: |
86+
git clone https://github.com/catalyst-team/hydra-slayer.git --branch gh-pages --single-branch gh-pages
87+
cd gh-pages
88+
\cp -a ../builds/* .
89+
# commit changes
90+
git config --local user.email "action@ithub.com"
91+
git config --local user.name "GitHub Action"
92+
git add .
93+
git commit -m "${TAG:=master docs}" || true
94+
95+
- name: push changes
96+
uses: ad-m/github-push-action@master
97+
with:
98+
branch: gh-pages
99+
directory: gh-pages
100+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/deploy_push.yml

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
name: deploy-docs-on-push
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
# any tags
8+
9+
jobs:
10+
11+
build-docs:
12+
runs-on: ubuntu-latest
13+
strategy:
14+
matrix:
15+
python-version: [3.8]
16+
17+
steps:
18+
- uses: actions/checkout@v2
19+
- name: Set up Python
20+
uses: actions/setup-python@v2
21+
with:
22+
python-version: ${{ matrix.python-version }}
23+
24+
- name: Install poetry
25+
run: |
26+
pip install -U pip
27+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
28+
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
29+
- name: Set up cache
30+
uses: actions/cache@v2
31+
with:
32+
path: .venv
33+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
34+
- name: Install dependencies
35+
run: |
36+
poetry config virtualenvs.in-project true
37+
poetry run pip install -U pip
38+
poetry install
39+
40+
- name: make docs
41+
run: |
42+
rm -rf builds
43+
git fetch --all --tags
44+
poetry run sphinx-multiversion docs/ builds/
45+
46+
- name: commit documentation changes
47+
env:
48+
TAG: "${{ github.event.release.tag_name }}"
49+
run: |
50+
git clone https://github.com/catalyst-team/hydra-slayer.git --branch gh-pages --single-branch gh-pages
51+
cd gh-pages
52+
rm -rf master
53+
\cp -a ../builds/* .
54+
# commit changes
55+
git config --local user.email "action@ithub.com"
56+
git config --local user.name "GitHub Action"
57+
git add .
58+
git commit -m "${TAG:=master docs}" || true
59+
60+
- name: push changes
61+
uses: ad-m/github-push-action@master
62+
with:
63+
branch: gh-pages
64+
directory: gh-pages
65+
github_token: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/test.yml

Lines changed: 60 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,60 @@
1+
name: test
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
pull_request:
8+
branches:
9+
- develop
10+
- master
11+
12+
jobs:
13+
14+
build:
15+
runs-on: ${{ matrix.os }}
16+
strategy:
17+
fail-fast: false
18+
max-parallel: 4
19+
matrix:
20+
os: [ubuntu-18.04, ubuntu-latest]
21+
python-version: [3.6, 3.7, 3.8, 3.9]
22+
requirements: ['latest', 'minimal']
23+
24+
steps:
25+
- uses: actions/checkout@v2
26+
- name: Set up Python
27+
uses: actions/setup-python@v2
28+
with:
29+
python-version: ${{ matrix.python-version }}
30+
31+
- name: Install poetry
32+
run: |
33+
pip install -U pip
34+
curl -sSL "https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py" | python -
35+
echo "${HOME}/.poetry/bin" >> $GITHUB_PATH
36+
- name: Set up cache
37+
uses: actions/cache@v2
38+
with:
39+
path: .venv
40+
key: venv-${{ matrix.python-version }}-${{ hashFiles('poetry.lock') }}
41+
- name: Install dependencies
42+
run: |
43+
poetry config virtualenvs.in-project true
44+
poetry run pip install -U pip
45+
poetry install
46+
- name: Install latest dependencies
47+
if: matrix.requirements == 'latest'
48+
run: |
49+
poetry update
50+
51+
- name: Unit tests
52+
env:
53+
REQUIREMENTS: ${{ matrix.requirements }}
54+
run: |
55+
poetry run pytest .
56+
57+
- name: Check dependencies compatibility
58+
run: |
59+
poetry run poetry check
60+
poetry run pip check

.mergify.yml

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
pull_request_rules:
2+
# removes reviews done by collaborators when the pull request is updated
3+
- name: remove outdated reviews
4+
conditions:
5+
- base=master
6+
actions:
7+
dismiss_reviews:
8+
9+
# automatic merge for master when required CI passes
10+
- name: automatic merge for master when CI passes and 2 review
11+
conditions:
12+
- "#approved-reviews-by>=2"
13+
- label!=WIP
14+
actions:
15+
merge:
16+
method: squash
17+
18+
# deletes the head branch of the pull request, that is the branch which hosts the commits
19+
- name: delete head branch after merge
20+
conditions:
21+
- merged
22+
actions:
23+
delete_head_branch: {}
24+
25+
# ask author of PR to resolve conflict
26+
- name: ask to resolve conflict
27+
conditions:
28+
- conflict
29+
actions:
30+
comment:
31+
message: "This pull request is now in conflicts. @{{ author }}, could you fix it? 🙏"

README.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1 +1,6 @@
11
# Hydra Slayer
2+
3+
Hydra Slayer is a 4th level spell in the School of Fire Magic.
4+
Depending of the level of expertise in fire magic,
5+
slayer spell increases attack of target troop by 8 against
6+
hydras, snakes (especially pythons), and other creatures.

docs/Makefile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# Minimal makefile for Sphinx documentation
2+
#
3+
4+
# You can set these variables from the command line, and also
5+
# from the environment for the first two.
6+
SPHINXOPTS ?=
7+
SPHINXBUILD ?= sphinx-build
8+
SOURCEDIR = .
9+
BUILDDIR = build
10+
11+
# Put it first so that "make" without argument is like "make help".
12+
help:
13+
@$(SPHINXBUILD) -M help "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
14+
15+
.PHONY: help Makefile
16+
17+
# Catch-all target: route all unknown targets to Sphinx using the new
18+
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
19+
%: Makefile
20+
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)

docs/_static/icon.png

13.2 KB
Loading

docs/_static/slayer.png

6.13 KB
Loading

0 commit comments

Comments
 (0)