Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 11 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# To get started with Dependabot version updates, you'll need to specify which
# package ecosystems to update and where the package manifests are located.
# Please see the documentation for all configuration options:
# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates

version: 2
updates:
- package-ecosystem: "pip" # See documentation for possible values
directory: "/" # Location of package manifests
schedule:
interval: "weekly"
6 changes: 6 additions & 0 deletions .github/renovate.json5
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"$schema": "https://docs.renovatebot.com/renovate-schema.json",
"extends": [
"local>kitsuyui/renovate-config"
]
}
16 changes: 16 additions & 0 deletions .github/workflows/gitignore-in.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Update gitignore file

on:
schedule:
# daily at 00:00
- cron: '0 0 * * *'

permissions:
contents: write
pull-requests: write

jobs:
update-gitignore:
runs-on: ubuntu-latest
steps:
- uses: gitignore-in/gh-action@v0.2.0
18 changes: 18 additions & 0 deletions .github/workflows/happy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
name: happy-commit
on:
- pull_request

permissions:
contents: read
pull-requests: write
issues: write

jobs:
happy:
runs-on: ubuntu-latest
name: happy
continue-on-error: true
steps:
- uses: kitsuyui/happy-commit@v0.9
with:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
57 changes: 57 additions & 0 deletions .github/workflows/pypi-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: Packaging

on:
pull_request:
types: [opened, synchronize, reopened]
release:
# "released" events are emitted either when directly be released or be edited from pre-released.
types: [prereleased, released]

env:
python_version: 3.12

jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: ${{ env.python_version }}

- name: Set up poetry
uses: abatilo/actions-poetry@v2

- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ env.python_version }}-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-build-${{ env.python_version }}-
${{ runner.os }}-

- run: poetry install

- name: Build
# I use poetry just as a package manager, so this is not `poetry build`
run: poetry run poe build

- name: Publish distribution to Test PyPI
uses: pypa/gh-action-pypi-publish@release/v1
if: github.event_name == 'release' && github.event.release.prerelease
with:
user: __token__
password: ${{ secrets.TEST_PYPI_API_TOKEN }}
repository-url: https://test.pypi.org/legacy/

- name: Publish distribution to PyPI
if: github.event_name == 'release' && !github.event.release.prerelease
uses: pypa/gh-action-pypi-publish@release/v1
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
66 changes: 66 additions & 0 deletions .github/workflows/python-test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
name: Test
on:
- pull_request

jobs:
test:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
python: ["3.8", "3.9", "3.10", "3.11", "3.12"]

steps:
- name: Checkout
uses: actions/checkout@v4

- name: Set up Python
id: setup-python
uses: actions/setup-python@v5
with:
python-version: "${{ matrix.python }}"

- name: Set up poetry
uses: abatilo/actions-poetry@v2

- name: Cache
uses: actions/cache@v3
with:
path: ~/.cache/pypoetry/virtualenvs
key: ${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
restore-keys: |
${{ runner.os }}-build-${{ matrix.python }}-${{ hashFiles('**/poetry.lock') }}
${{ runner.os }}-build-${{ matrix.python }}-
${{ runner.os }}-

- name: Install dependencies
run: poetry install

- name: Lint
run: poetry run poe check

- name: Check Python version
run: |
actual_version=$(poetry run python --version)
expected_version="Python ${{ matrix.python }}"
if [ "$actual_version" == *"$expected_version"* ]; then
echo "Expected $expected_version, but got $actual_version"
exit 1
fi

- name: Test
run: poetry run poe test

- name: Coverage
run: poetry run poe coverage-xml

- name: Upload coverage report to Codecov
if: matrix.python == '3.12'
uses: codecov/codecov-action@v3
with:
token: ${{ secrets.CODECOV_TOKEN }}
files: ./coverage.xml
flags: unittests
name: codecov-umbrella
fail_ci_if_error: true
verbose: true
16 changes: 16 additions & 0 deletions .github/workflows/spellcheck.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
name: Spellcheck
on:
- pull_request
permissions:
contents: read
jobs:
check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4

- name: Check spelling
uses: crate-ci/typos@master
# typos is a Source code spell checker
# https://github.com/crate-ci/typos
Loading