Skip to content

Commit

Permalink
v0.1.0rc0 (#1)
Browse files Browse the repository at this point in the history
* 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
bagxi authored Jul 26, 2021
1 parent db2532c commit 9691ca1
Show file tree
Hide file tree
Showing 31 changed files with 2,248 additions and 127 deletions.
90 changes: 90 additions & 0 deletions .github/workflows/codestyle.yml
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
100 changes: 100 additions & 0 deletions .github/workflows/deploy_publish.yml
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 }}
65 changes: 65 additions & 0 deletions .github/workflows/deploy_push.yml
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 }}
60 changes: 60 additions & 0 deletions .github/workflows/test.yml
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
31 changes: 31 additions & 0 deletions .mergify.yml
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? 🙏"
5 changes: 5 additions & 0 deletions README.md
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.
20 changes: 20 additions & 0 deletions docs/Makefile
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)
Binary file added docs/_static/icon.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added docs/_static/slayer.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading

0 comments on commit 9691ca1

Please sign in to comment.