Commit fa06061f authored by Federico Falconieri's avatar Federico Falconieri
Browse files

Merge branch 'fix_mypy_junit-xml' into 'master'

fix: improves mypy gitlab UX with mypy2junit

See merge request ci/templates!4
parents 91df595c fbf21a74
Loading
Loading
Loading
Loading
+7 −2
Original line number Diff line number Diff line
# https://github.com/python/mypy
# this job uses mypy2junit to get the junitxml report in gitlab CI

variables:
  PYTHON_TEST: "true"
@@ -8,10 +9,14 @@ python:mypy:
  image: registry.gitlab.com/notno/python-tests
  variables:
    CHECK_PATH: "./${PYTHON_PACKAGE}"
    DEFAULT_SETTINGS: "--strict --ignore-missing-imports --pretty --show-error-context"  # Override this for special needs
    DEFAULT_SETTINGS: "--strict --ignore-missing-imports --show-error-context"  # Override this for special needs
    EXTRA_SETTINGS: ""  # Use this to add your settings to the default
  script:
    - mypy ${DEFAULT_SETTINGS} ${EXTRA_SETTINGS} --junit-xml mypy-report.xml ${CHECK_PATH}
    # stdout 
    - mypy ${DEFAULT_SETTINGS} ${EXTRA_SETTINGS} ${CHECK_PATH} | tee mypy.out || exit_code=$?
    # junitxml
    - mypy2junit mypy.out > mypy-report.xml
    - exit $exit_code
  artifacts:
    reports:
      junit: mypy-report.xml