chore: add code check action

This commit is contained in:
fl0pp5 2024-11-18 17:45:18 +03:00
parent b73ff64fcf
commit e38e31b084
5 changed files with 35 additions and 8 deletions

29
.github/workflows/check.yml vendored Normal file
View File

@ -0,0 +1,29 @@
name: Code check
on:
workflow_dispatch:
pull_request:
branches:
- main
push:
branches:
- main
jobs:
build:
name: Code check
runs-on: alt-sisyphus
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Update index
run: apt-get update
- name: Install dependencies
run: apt-get install -y python3-module-loguru python3-module-pydantic python3-module-typer python3-module-rich python3-module-mypy python3-module-flake8 python3-module-flake8-import-order
- name: Run flake8
run: make lint
- name: Run mypy
run: make type-check

View File

@ -1,9 +1,9 @@
lint:
flake8 alt alt-ostree.py \
flake8 alt alt-ostree \
--count \
--statistics \
--append-config=.flake8 \
--show-source
type-check:
mypy --config-file=.mypy.ini --pretty --explicit-package-bases alt alt-ostree.py
mypy --config-file=.mypy.ini --pretty --explicit-package-bases alt alt-ostree

View File

@ -19,8 +19,8 @@ logger.configure(handlers=[{"sink": sys.stderr, "format": _custom_formatter}])
app = typer.Typer()
app.add_typer(cmd_rootfs.app, name="rootfs")
app.add_typer(cmd_repo.app, name="repo")
app.add_typer(cmd_rootfs.app, name="rootfs", help="Rootfs related operations")
app.add_typer(cmd_repo.app, name="repo", help="Repository related operations")
if __name__ == "__main__":

View File

@ -5,4 +5,4 @@ from alt.command.rootfs import build as cmd_build
app = typer.Typer()
app.add_typer(cmd_build.app, name="build")
app.add_typer(cmd_build.app, name="build", help="Build related commands")

View File

@ -103,6 +103,4 @@ def prepare_build(opts: PrepareOptions) -> None:
f"rpm-dir file:{apt_dir} {arch} dir\n"
)
logger.info(f"{arch}-{branch}: {cur_dir}")
logger.info("done")
logger.info(f"{branch}-{arch}: {cur_dir.absolute()}")