Skip to content

Commit

Permalink
ci 스크립트 생성 및 설정파일 변경
Browse files Browse the repository at this point in the history
  • Loading branch information
im-niber committed Aug 13, 2024
1 parent c8773d7 commit c60ff75
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 84 deletions.
53 changes: 8 additions & 45 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -1,41 +1,14 @@
name: Customk CI

on:
pull_request:
on: [push]
# pull_request:

jobs:
ci:
runs-on: ubuntu-22.04
steps:
- name: Login in to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USER }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Check out the codes
uses: actions/checkout@v2

- name: Setup python environment
id: setup-python
uses: actions/setup-python@v5
with:
python-version: 3.12

- name: Set timezone to KST
run: |
sudo rm /etc/localtime
sudo ln -s /usr/share/zoneinfo/Asia/Seoul /etc/localtime
- name: Install Poetry
run: |
curl -sSL curl -sSL https://install.python-poetry.org | python3 -
echo "${HOME}/.local/bin" >> $GITHUB_PATH
- name: Regenerate lock file
run: |
poetry lock --no-update
uses: actions/checkout@v4

- name: Install poetry
run: pipx install poetry
Expand All @@ -44,23 +17,13 @@ jobs:
python-version: '3.12'
cache: 'poetry'

- name: Run black
run: |
poetry run black . --check
- name: package install
run: poetry install

- name: Run isort
- name: Run Luff
run: |
poetry run isort . --check --diff
- name: Create .env file
run: |
echo "${{ secrets.ENV_FILE_CONTENT }}" > .env
poetry run ruff check .
- name: Run Mypy
run: |
poetry run mypy .
- name: Test python project
run: |
poetry run python manage.py test &&
docker-compose run --rm app sh -c "python manage.py test"
poetry run mypy .
18 changes: 18 additions & 0 deletions customk/mypy.ini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
[mypy]
plugins = mypy_django_plugin.main, mypy_drf_plugin.main
python_version = 3.12
ignore_missing_imports = True
strict = True
follow_imports = silent

[mypy-*.migrations.*]
ignore_errors = True

[mypy-manage]
ignore_errors = True

[mypy-*.tests.*]
ignore_errors = True

[mypy.plugins.django-stubs]
django_settings_module = config.settings
14 changes: 14 additions & 0 deletions customk/ruff.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
line-length = 100

[lint]
select = ['E', 'F', 'W', 'A', 'PLC', 'PLE', 'PLW', 'I']
ignore = [
"E402", # false positives for local imports
"E501", # line too long
"F401", # 사용되지 않는 임포트에 대한 경고.
"W191", # 탭을 사용한 들여쓰기에 대한 경고
]

[format]
quote-style = "double"
indent-style = "tab"
39 changes: 0 additions & 39 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -20,42 +20,3 @@ djangorestframework-stubs = "^3.15.0"
[build-system]
requires = ["poetry-core"]
build-backend = "poetry.core.masonry.api"

[tool.ruff]
line-length = 100

[tool.ruff.lint]
select = ['E', 'F', 'W', 'A', 'PLC', 'PLE', 'PLW', 'I']
ignore = [
"E402", # false positives for local imports
"E501", # line too long
"F401", # 사용되지 않는 임포트에 대한 경고.
"W191", # 탭을 사용한 들여쓰기에 대한 경고
]

[tool.ruff.format]
quote-style = "double"
indent-style = "tab"

[tool.mypy]
mypy_path = "./customk"
plugins = ["mypy_django_plugin.main", "mypy_drf_plugin.main"]
python_version = 3.12
ignore_missing_imports = true
strict = true
follow_imports = "silent"

[[tool.mypy.overrides]]
module = "*.migrations.*"
ignore_errors = true

[[tool.mypy.overrides]]
module = "manage"
ignore_errors = true

[[tool.mypy.overrides]]
module = "*.tests.*"
ignore_errors = true

[tool.django-stubs]
django_settings_module = "config.settings"

0 comments on commit c60ff75

Please sign in to comment.