Skip to content
Snippets Groups Projects
.gitlab-ci.yml 2.15 KiB
Newer Older
###############################################################################
Eduardo Rodrigues's avatar
Eduardo Rodrigues committed
# (c) Copyright 2018-2021 CERN for the benefit of the LHCb Collaboration      #
#                                                                             #
# This software is distributed under the terms of the GNU General Public      #
# Licence version 3 (GPL Version 3), copied verbatim in the file "COPYING".   #
#                                                                             #
# In applying this licence, CERN does not waive the privileges and immunities #
# granted to it by virtue of its status as an Intergovernmental Organization  #
# or submit itself to any jurisdiction.                                       #
###############################################################################
variables:
  TARGET_BRANCH: master

check-copyright:
  image: gitlab-registry.cern.ch/ci-tools/ci-worker:cc7
  script:
    - curl -o lb-check-copyright "https://gitlab.cern.ch/lhcb-core/LbDevTools/raw/master/LbDevTools/SourceTools.py?inline=false"
    - python lb-check-copyright origin/${TARGET_BRANCH}
Eduardo Rodrigues's avatar
Eduardo Rodrigues committed

check-formatting:
  image: gitlab-registry.cern.ch/lhcb-docker/style-checker
  script:
    - if [ ! -e .clang-format ] ; then
    -   curl -o .clang-format "https://gitlab.cern.ch/lhcb-core/LbDevTools/raw/master/LbDevTools/data/default.clang-format?inline=false"
    -   echo '.clang-format' >> .gitignore
    -   git add .gitignore
    - fi
    - curl -o lb-format "https://gitlab.cern.ch/lhcb-core/LbDevTools/raw/master/LbDevTools/SourceTools.py?inline=false"
    - python lb-format --format-patch apply-formatting.patch origin/${TARGET_BRANCH}
  artifacts:
    paths:
      - apply-formatting.patch
    when: on_failure
    expire_in: 1 week

python-linting:
  tags:
    - cvmfs
  script:
    - . /cvmfs/lhcb.cern.ch/lib/LbEnv.sh
    # Only run the pyflakes linter and a few select pycodestyle errors
    # Lint a single file because much of the code in DaVinci is yet to be checked whether it will be kept for run 3.
    # This one file has been updated to pass the linter checks!
    - flake8 --exclude '*.opts.py' --select=F,E71,E9,W1,W6 $(find Phys/DaVinci -name 'ConfigurationUpgrade.py')