mirror of
https://github.com/containers/ramalama.git
synced 2026-02-05 06:46:39 +01:00
ci: run type checking
Add a "make type-check" Makefile target, and run it as part of the CI workflow. Add a couple extra depedencies to enable type checking for yaml and jsonschema. Signed-off-by: Mike Bonnet <mikeb@redhat.com>
This commit is contained in:
4
.github/workflows/ci.yml
vendored
4
.github/workflows/ci.yml
vendored
@@ -36,6 +36,10 @@ jobs:
|
||||
run: |
|
||||
uv run -- make man-check
|
||||
|
||||
- name: Run type checking
|
||||
run: |
|
||||
uv run -- make type-check
|
||||
|
||||
build-image:
|
||||
runs-on: ubuntu-24.04
|
||||
timeout-minutes: 60
|
||||
|
||||
8
Makefile
8
Makefile
@@ -10,7 +10,7 @@ PATH := $(PATH):$(HOME)/.local/bin
|
||||
MYPIP ?= pip
|
||||
IMAGE ?= ramalama
|
||||
PROJECT_DIR:=$(shell dirname $(realpath $(lastword $(MAKEFILE_LIST))))
|
||||
EXCLUDE_DIRS := .venv venv .tox
|
||||
EXCLUDE_DIRS := .venv venv .tox build
|
||||
EXCLUDE_OPTS := $(addprefix --exclude-dir=,$(EXCLUDE_DIRS))
|
||||
PYTHON_SCRIPTS := $(shell grep -lEr "^\#\!\s*/usr/bin/(env +)?python(3)?(\s|$$)" $(EXCLUDE_OPTS) $(PROJECT_DIR) || true)
|
||||
BATS_IMAGE ?= localhost/bats:latest
|
||||
@@ -146,8 +146,12 @@ ifeq ($(OS),Linux)
|
||||
hack/xref-helpmsgs-manpages
|
||||
endif
|
||||
|
||||
.PHONY: type-check
|
||||
type-check:
|
||||
mypy $(addprefix --exclude=,$(EXCLUDE_DIRS)) --exclude test $(PROJECT_DIR)
|
||||
|
||||
.PHONY: validate
|
||||
validate: codespell lint check-format man-check
|
||||
validate: codespell lint check-format man-check type-check
|
||||
|
||||
.PHONY: pypi-build
|
||||
pypi-build: clean
|
||||
|
||||
@@ -65,6 +65,8 @@ dev = [
|
||||
"pytest~=8.3",
|
||||
"wheel~=0.45.0",
|
||||
"mypy",
|
||||
"types-PyYAML",
|
||||
"types-jsonschema",
|
||||
"tox"
|
||||
]
|
||||
|
||||
|
||||
Reference in New Issue
Block a user