-
Notifications
You must be signed in to change notification settings - Fork 8
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new tests, type hinting, resolve issues (#17)
- Loading branch information
Showing
40 changed files
with
2,033 additions
and
773 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,94 @@ | ||
name: CI/CD Workflow | ||
|
||
on: | ||
push: | ||
branches: ['*'] | ||
pull_request: | ||
branches: [ main ] | ||
|
||
jobs: | ||
type-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12.2' | ||
- name: Install Poetry | ||
run: pip install poetry | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Perform type checking | ||
run: poetry run mypy . | ||
run-tests: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12.2' | ||
- name: Install Poetry | ||
run: pip install poetry | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Execute tests | ||
run: poetry run pytest | ||
|
||
code-style-check: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v2 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12.2' | ||
- name: Install Poetry | ||
run: pip install poetry | ||
- name: Install dependencies | ||
run: poetry install | ||
- name: Check code style | ||
run: poetry run ruff check | ||
|
||
release: | ||
needs: [run-tests, code-style-check, type-check] | ||
runs-on: ubuntu-latest | ||
if: github.ref == 'refs/heads/main' && github.event_name == 'push' | ||
steps: | ||
- uses: actions/checkout@v2 | ||
with: | ||
fetch-depth: 0 | ||
- name: Set up Python | ||
uses: actions/setup-python@v2 | ||
with: | ||
python-version: '3.12.2' | ||
- name: Install Dependencies | ||
run: | | ||
pip install poetry | ||
poetry install | ||
- name: Semantic Release | ||
run: poetry run semantic-release publish | ||
env: | ||
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
#PYPI_TOKEN: ${{ secrets.PYPI_API_TOKEN }} | ||
|
||
|
||
# publish: | ||
# needs: [run-tests, code-style-check, type-check] | ||
# runs-on: ubuntu-latest | ||
# steps: | ||
# - uses: actions/checkout@v2 | ||
# - name: Set up Python | ||
# uses: actions/setup-python@v2 | ||
# with: | ||
# python-version: '3.12.2' | ||
# - name: Install Poetry | ||
# run: pip install poetry | ||
# - name: Install dependencies | ||
# run: poetry install | ||
# - name: Publish package | ||
# uses: pypa/gh-action-pypi-publish@master | ||
# with: | ||
# user: __token__ | ||
# password: ${{ secrets.PYPI_API_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,48 @@ | ||
ci: | ||
skip: [pytest] | ||
|
||
default_language_version: | ||
python: python3.12 | ||
|
||
repos: | ||
# general checks (see here: https://pre-commit.com/hooks.html) | ||
- repo: https://github.com/pre-commit/pre-commit-hooks | ||
rev: v4.5.0 | ||
hooks: | ||
- id: check-yaml | ||
args: [--allow-multiple-documents] | ||
- id: end-of-file-fixer | ||
- id: trailing-whitespace | ||
|
||
# black - formatting | ||
- repo: https://github.com/psf/black | ||
rev: 24.2.0 | ||
hooks: | ||
- id: black | ||
name: black | ||
args: | ||
- "--config" | ||
- "./pyproject.toml" | ||
|
||
# ruff - linting | ||
- repo: https://github.com/astral-sh/ruff-pre-commit | ||
rev: "v0.3.0" | ||
hooks: | ||
- id: ruff | ||
name: ruff | ||
|
||
# mypy - lint-like type checking | ||
- repo: https://github.com/pre-commit/mirrors-mypy | ||
rev: v1.8.0 | ||
hooks: | ||
- id: mypy | ||
name: mypy | ||
|
||
- repo: local | ||
hooks: | ||
- id: pytest | ||
name: pytest | ||
entry: poetry run pytest --cov=src tests | ||
language: system | ||
types: [python] | ||
pass_filenames: false |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.