From 5f47602aa1020d4b22f8394d7673e228ce05ba28 Mon Sep 17 00:00:00 2001 From: InsanePrawn Date: Fri, 18 Feb 2022 06:42:25 +0100 Subject: [PATCH] gitlab-ci: add mypy type-checking --- .gitlab-ci.yml | 11 +++++++++++ typecheck.sh | 2 ++ 2 files changed, 13 insertions(+) create mode 100755 typecheck.sh diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 0137119..fd1fb9d 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -10,6 +10,17 @@ format: script: - ./format.sh --check +typecheck: + stage: check + image: python + before_script: + - pip install mypy + script: + - ./typecheck.sh --non-interactive --junit-xml mypy-report.xml + artifacts: + reports: + junit: mypy-report.xml + build_docker: stage: build image: docker:latest diff --git a/typecheck.sh b/typecheck.sh new file mode 100755 index 0000000..8eadd89 --- /dev/null +++ b/typecheck.sh @@ -0,0 +1,2 @@ +#!/bin/bash +git ls-files \*.py | xargs mypy --pretty --install-types --ignore-missing-imports "$@"