Commit 8607071c authored by Cédric OLIVIER's avatar Cédric OLIVIER
Browse files

Update gitlab-ci-python.yml

parent 9c97675b
Loading
Loading
Loading
Loading
+7 −0
Original line number Diff line number Diff line
@@ -351,11 +351,13 @@ py-lint:
      then
        # failed: also generate codeclimate report
        mkdir -p reports
        chmod o+rwx reports
        pylint --ignore=.cache --output-format=pylint_gitlab.GitlabCodeClimateReporter  ${PYLINT_ARGS} ${PYLINT_FILES:-$(find -type f -name "*.py")} > reports/pylint-codeclimate.json
        exit 1
      else
        # success: generate empty codeclimate report (required by GitLab :( )
        mkdir -p reports
        chmod o+rwx reports
        echo "[]" > reports/pylint-codeclimate.json
      fi
  artifacts:
@@ -399,6 +401,7 @@ py-unittest:
  stage: build
  script:
    - mkdir -p reports
    - chmod o+rwx reports
    - install_requirements
    - install_test_requirements
    # code coverage
@@ -433,6 +436,7 @@ py-pytest:
    - install_requirements
    - install_test_requirements
    - mkdir -p reports
    - chmod o+rwx reports
    - pip install -U pytest pytest-cov coverage
    - python -m pytest --junit-xml=reports/TEST-pytests.xml --cov --cov-report term  --cov-report xml:reports/coverage.xml ${PYTEST_ARGS}
  coverage: /^TOTAL.+?(\d+\%)$/
@@ -460,6 +464,7 @@ py-nosetests:
    - install_requirements
    - install_test_requirements
    - mkdir -p reports
    - chmod o+rwx reports
    - nosetests --with-xunit --xunit-file=reports/TEST-nosetests.xml --with-coverage --cover-erase --cover-xml --cover-xml-file=reports/coverage.xml --cover-html --cover-html-dir=reports/coverage ${NOSETESTS_ARGS}
  coverage: /^TOTAL.+?(\d+\%)$/
  artifacts:
@@ -492,6 +497,7 @@ py-bandit:
      then
        # failed: also generate JSON report
        mkdir -p reports
        chmod o+rwx reports
        bandit ${TRACE+--verbose} --format json --output reports/bandit.json ${BANDIT_ARGS}
        exit 1
      fi
@@ -528,6 +534,7 @@ py-safety:
      then
        # failed: also generate JSON report
        mkdir -p reports
        chmod o+rwx reports
        pip freeze | safety check --stdin --json --output reports/safety.json ${SAFETY_ARGS}
        exit 1
      fi