Skip to content
Snippets Groups Projects
.gitlab-ci.yml 1.7 KiB
Newer Older
  • Learn to ignore specific revisions
  • image: registry.git.cccv.de/infra/uffd/docker-images/buster
    
    nd's avatar
    nd committed
    
    variables:
      DEBIAN_FRONTEND: noninteractive 
    
      GIT_SUBMODULE_STRATEGY: normal
      PYTHONPATH: deps/ldapalchemy
    
    nd's avatar
    nd committed
    
    before_script:
      - python3 -V
    
    nd's avatar
    nd committed
      - lsb_release -a
    
    nd's avatar
    nd committed
      - uname -a
    
      - python3 -m pylint --version
      - python3 -m coverage --version
    
    nd's avatar
    nd committed
    
    linter:
      stage: test
      script:
    
      - pip3 install pylint-gitlab # this force-updates jinja2 and some other packages!
      - python3 -m pylint --exit-zero --rcfile .pylintrc --output-format=pylint_gitlab.GitlabCodeClimateReporter uffd > codeclimate.json
      - python3 -m pylint --exit-zero --rcfile .pylintrc --output-format=pylint_gitlab.GitlabPagesHtmlReporter uffd > pylint.html
      - python3 -m pylint --rcfile .pylintrc --output-format=text uffd
    
    nd's avatar
    nd committed
      artifacts:
    
        when: always
        paths:
        - pylint.html
        reports:
          codequality: codeclimate.json
    
    nd's avatar
    nd committed
    
    
      - service slapd start
    
      - UNITTEST_OPENLDAP=1 python3-coverage run --include 'uffd/*.py' -m pytest --junitxml=report.xml || true
    
      - python3-coverage report -m
      - python3-coverage html
      - python3-coverage xml
      artifacts:
        when: always
        paths:
        - htmlcov/index.html
        - htmlcov
        expose_as: 'Coverage Report'
        reports:
          cobertura: coverage.xml
          junit: report.xml
      coverage: '/^TOTAL.*\s+(\d+\%)$/'
    
    html5validator:
      stage: test
      script:
      - rm -rf pages
      - mkdir -p pages
      - cp -r uffd/static pages/static
      - DUMP_PAGES=pages python3 -m unittest discover tests
      - sed -i -e 's/href="\/static\//href=".\/static\//g' -e 's/src="\/static\//src=".\/static\//g' pages/*.html
      - html5validator --root pages 2>&1 | tee html5validator.log
      artifacts:
        when: on_failure
        paths:
        - pages
        - html5validator.log