From dc06d7e0f44a7c5ddf6a4ecfb5bd0b0f640739ca Mon Sep 17 00:00:00 2001 From: Bosen Qu Date: Sat, 30 Dec 2023 07:39:07 +0000 Subject: [PATCH] Add mypy reports to CI summary --- .github/workflows/ci.yml | 16 ++++++++++++++++ Makefile | 3 +-- 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 03c5d88..edeaf8c 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -59,3 +59,19 @@ jobs: run: make setup install-dev - name: Lint with ruff, reformat-gherkin, and mypy run: make lint-ci + - name: Add mypy reports to summary + run: | + echo "**Mypy line precision report**" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat reports/mypy/lineprecision.txt >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + echo "**Mypy \`Any\` expression report**" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat reports/mypy/any-exprs.txt >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + + echo "**Mypy types of \`Any\` report**" >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY + cat reports/mypy/types-of-anys.txt >> $GITHUB_STEP_SUMMARY + echo "\`\`\`" >> $GITHUB_STEP_SUMMARY diff --git a/Makefile b/Makefile index 6407584..d6febb6 100644 --- a/Makefile +++ b/Makefile @@ -41,7 +41,6 @@ test: # Run unit and feature tests with test (junit) and coverage (cobertura) report .PHONNY: test-ci test-ci: - rm -fr $(REPORTS) $(PYTHON) -m coverage run --data-file $(REPORTS)/unit_tests/coverage.dat \ -m pytest -v --junitxml=$(REPORTS)/unit_tests/junit.xml $(PYTHON) -m coverage run --data-file $(REPORTS)/feature_tests/coverage.dat \ @@ -67,7 +66,7 @@ lint: # Run make lint with more verbose messages .PHONNY: lint-ci lint-ci: - $(PYTHON) -m mypy -v . + $(PYTHON) -m mypy -v --any-exprs-report $(REPORTS)/mypy/ --lineprecision-report $(REPORTS)/mypy/ . $(PYTHON) -m ruff check -v . $(VENV)/bin/reformat-gherkin --check tests/features