diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 129365b..d09535a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -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 @@ -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" \ No newline at end of file + poetry run mypy . \ No newline at end of file diff --git a/customk/mypy.ini b/customk/mypy.ini new file mode 100644 index 0000000..baefac4 --- /dev/null +++ b/customk/mypy.ini @@ -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 \ No newline at end of file diff --git a/customk/ruff.toml b/customk/ruff.toml new file mode 100644 index 0000000..88ac9e9 --- /dev/null +++ b/customk/ruff.toml @@ -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" \ No newline at end of file diff --git a/pyproject.toml b/pyproject.toml index a817106..904e7af 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -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" \ No newline at end of file