Skip to content

Commit

Permalink
try add ci
Browse files Browse the repository at this point in the history
  • Loading branch information
apple1417 committed Oct 10, 2024
1 parent 81f9131 commit c233bca
Show file tree
Hide file tree
Showing 7 changed files with 91 additions and 12 deletions.
74 changes: 74 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
name: CI

on: [push, pull_request]

jobs:
spelling:
runs-on: ubuntu-latest

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

- name: Check spelling
uses: crate-ci/typos@master

pyright:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: console_mod_menu

- name: Checkout stubs
uses: actions/checkout@v4
with:
repository: bl-sdk/pyunrealsdk
path: pyunrealsdk
sparse-checkout: |
stubs
- name: Checkout mods_base
uses: actions/checkout@v4
with:
repository: bl-sdk/mods_base
path: mods_base

- name: Add stubs to pyproject
run: >
sed
's/# CI ADD STUB PATH HERE/stubPath = "pyunrealsdk\/stubs"\nreportMissingModuleSource = false/'
console_mod_menu/pyproject.toml
> pyproject.toml
- name: Run pyright
uses: jakebailey/pyright-action@v2
with:
extra-args: console_mod_menu

ruff:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
path: console_mod_menu

- name: Checkout mods_base
uses: actions/checkout@v4
with:
repository: bl-sdk/mods_base
path: mods_base

- name: Run Ruff Linting
uses: chartboost/ruff-action@v1
with:
args: check console_mod_menu

- name: Run Ruff Formatting
uses: chartboost/ruff-action@v1
with:
args: format --check console_mod_menu
2 changes: 2 additions & 0 deletions pyproject.toml
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ pythonVersion = "3.13"
typeCheckingMode = "strict"
pythonPlatform = "Windows"

# CI ADD STUB PATH HERE

[tool.ruff]
target-version = "py313"
line-length = 100
Expand Down
3 changes: 2 additions & 1 deletion screens/__init__.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from abc import ABC, abstractmethod
from dataclasses import dataclass

from console_mod_menu.draw import draw
from mods_base import capture_next_console_line

from console_mod_menu.draw import draw


@dataclass
class AbstractScreen(ABC):
Expand Down
3 changes: 2 additions & 1 deletion screens/home.py
Original file line number Diff line number Diff line change
@@ -1,9 +1,10 @@
from dataclasses import dataclass, field
from typing import Literal

from console_mod_menu.draw import draw
from mods_base import Mod, get_ordered_mod_list, html_to_plain_text

from console_mod_menu.draw import draw

from . import (
AbstractScreen,
draw_stack_header,
Expand Down
8 changes: 4 additions & 4 deletions screens/keybind.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
from dataclasses import dataclass, field
from typing import TYPE_CHECKING

from unrealsdk.hooks import Block

from console_mod_menu.draw import draw
from console_mod_menu.key_matching import KNOWN_KEYS, suggest_keys
from mods_base import (
EInputEvent,
KeybindOption,
remove_next_console_line_capture,
)
from unrealsdk.hooks import Block

from console_mod_menu.draw import draw
from console_mod_menu.key_matching import KNOWN_KEYS, suggest_keys

from . import (
AbstractScreen,
Expand Down
8 changes: 4 additions & 4 deletions screens/mod.py
Original file line number Diff line number Diff line change
@@ -1,10 +1,6 @@
from collections.abc import Iterable, Sequence
from dataclasses import dataclass, field

from unrealsdk import logging

from console_mod_menu.draw import draw, draw_description
from console_mod_menu.option_formatting import draw_option_header, get_option_value_str
from mods_base import (
JSON,
BaseOption,
Expand All @@ -20,6 +16,10 @@
SpinnerOption,
ValueOption,
)
from unrealsdk import logging

from console_mod_menu.draw import draw, draw_description
from console_mod_menu.option_formatting import draw_option_header, get_option_value_str

from . import (
AbstractScreen,
Expand Down
5 changes: 3 additions & 2 deletions screens/option.py
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,6 @@
from abc import abstractmethod
from dataclasses import dataclass, field

from console_mod_menu.draw import draw
from console_mod_menu.option_formatting import draw_option_header
from mods_base import (
JSON,
BaseOption,
Expand All @@ -17,6 +15,9 @@
ValueOption,
)

from console_mod_menu.draw import draw
from console_mod_menu.option_formatting import draw_option_header

from . import AbstractScreen, draw_standard_commands, handle_standard_command_input


Expand Down

0 comments on commit c233bca

Please sign in to comment.