Skip to content

Commit

Permalink
Use github actions (#13)
Browse files Browse the repository at this point in the history
  • Loading branch information
moonbings committed Feb 4, 2022
2 parents 6c8d019 + 6678eda commit 70afc05
Show file tree
Hide file tree
Showing 146 changed files with 255 additions and 27,038 deletions.
172 changes: 172 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,172 @@
name: CI

on: pull_request

jobs:
black:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install black
run: pip install --upgrade black==22.1.0
- name: Run black
run: black --check .

isort:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install isort
run: pip install --upgrade isort==5.10.1
- name: Run isort
run: isort --profile black --check .

mypy:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install mypy
run: pip install --upgrade mypy
- name: Run mypy
run: mypy --ignore-missing-imports synthtiger

pylint:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.8']
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install pylint
run: pip install --upgrade pylint
- name: Run pylint
run: pylint --errors-only -s y synthtiger

pytest-ubuntu:
runs-on: ubuntu-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install pytest
run: pip install --upgrade pytest
- name: Run pytest
run: pytest .

pytest-macos:
runs-on: macos-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_macos_depends.sh
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install pytest
run: pip install --upgrade pytest
- name: Run pytest
run: pytest .

pytest-windows:
runs-on: windows-latest
strategy:
matrix:
python: ['3.6', '3.7', '3.8', '3.9']
fail-fast: false
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up MSYS2
uses: msys2/setup-msys2@v2
- name: Install dependencies
run: msys2 depends/install_windows_depends.sh
- name: Add dependency path
run: echo "D:\a\_temp\msys64\mingw64\bin" >> $env:GITHUB_PATH
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: ${{ matrix.python }}
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install pytest
run: pip install --upgrade pytest
- name: Run pytest
run: pytest .
31 changes: 31 additions & 0 deletions .github/workflows/gh-pages.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Github Pages

on:
push:
branches: [master]

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Install dependencies
run: bash depends/install_ubuntu_depends.sh
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Upgrade pip, setuptools and wheel
run: python -m pip install --upgrade pip setuptools wheel
- name: Install requirements
run: pip install --upgrade -r requirements.txt
- name: Install sphinx
run: pip install --upgrade sphinx sphinx-rtd-theme
- name: Build docs
run: make -C docs clean html
- name: Deploy docs
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: docs/_build/html
4 changes: 2 additions & 2 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
repos:
- repo: https://github.com/psf/black
rev: 21.6b0
rev: 22.1.0
hooks:
- id: black
stages: [commit]
- repo: https://github.com/pycqa/isort
rev: 5.9.1
rev: 5.10.1
hooks:
- id: isort
args: [--profile, black, --filter-files]
Expand Down
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,6 +232,5 @@ THE SOFTWARE.
The following directories and their subdirectories are licensed the same as their origins. Please refer to [NOTICE](NOTICE)
```
docs/
docsrc/
resources/font/
```
8 changes: 8 additions & 0 deletions depends/install_macos_depends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
brew install \
libtiff \
libjpeg \
webp \
little-cms2 \
freetype \
harfbuzz \
fribidi
14 changes: 14 additions & 0 deletions depends/install_ubuntu_depends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
sudo apt install -y \
libtiff5-dev \
libjpeg8-dev \
libopenjp2-7-dev \
zlib1g-dev \
libfreetype6-dev \
liblcms2-dev \
libwebp-dev \
tcl8.6-dev \
tk8.6-dev \
python3-tk \
libharfbuzz-dev \
libfribidi-dev \
libxcb1-dev
10 changes: 10 additions & 0 deletions depends/install_windows_depends.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
pacman --noconfirm -S \
mingw-w64-x86_64-libjpeg-turbo \
mingw-w64-x86_64-zlib \
mingw-w64-x86_64-libtiff \
mingw-w64-x86_64-freetype \
mingw-w64-x86_64-lcms2 \
mingw-w64-x86_64-libwebp \
mingw-w64-x86_64-openjpeg2 \
mingw-w64-x86_64-libimagequant \
mingw-w64-x86_64-libraqm
4 changes: 0 additions & 4 deletions docs/.buildinfo

This file was deleted.

Empty file removed docs/.nojekyll
Empty file.
7 changes: 2 additions & 5 deletions docsrc/Makefile → docs/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,8 @@
# from the environment for the first two.
SPHINXOPTS ?=
SPHINXBUILD ?= sphinx-build
SOURCEDIR = source
BUILDDIR = build
DOCDIR = ../docs
SOURCEDIR = .
BUILDDIR = _build

# Put it first so that "make" without argument is like "make help".
help:
Expand All @@ -19,5 +18,3 @@ help:
# "make mode" option. $(O) is meant as a shortcut for $(SPHINXOPTS).
%: Makefile
@$(SPHINXBUILD) -M $@ "$(SOURCEDIR)" "$(BUILDDIR)" $(SPHINXOPTS) $(O)
@test -d "$(DOCDIR)" && rm -r "$(DOCDIR)" || true
@test -d "$(BUILDDIR)/html" && cp -r "$(BUILDDIR)/html" "$(DOCDIR)" || true
7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/color.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/component.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/corpus.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/font.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/image_effect.rst.txt

This file was deleted.

16 changes: 0 additions & 16 deletions docs/_sources/documentation/components/index.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/layout.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/text_effect.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/texture.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/transform.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/components/wrapper.rst.txt

This file was deleted.

9 changes: 0 additions & 9 deletions docs/_sources/documentation/index.rst.txt

This file was deleted.

7 changes: 0 additions & 7 deletions docs/_sources/documentation/layers/index.rst.txt

This file was deleted.

Loading

0 comments on commit 70afc05

Please sign in to comment.