chore: add code check action
This commit is contained in:
parent
b73ff64fcf
commit
e38e31b084
29
.github/workflows/check.yml
vendored
Normal file
29
.github/workflows/check.yml
vendored
Normal 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
|
4
Makefile
4
Makefile
@ -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
|
||||
|
@ -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__":
|
@ -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")
|
||||
|
@ -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()}")
|
||||
|
Loading…
x
Reference in New Issue
Block a user