Skip to content
Snippets Groups Projects
Code owners
Assign users and groups as approvers for specific file changes. Learn more.
.gitlab-ci.yml 4.15 KiB
# You can override the included template(s) by including variable overrides
# SAST customization: https://docs.gitlab.com/ee/user/application_security/sast/#customizing-the-sast-settings
# Secret Detection customization: https://docs.gitlab.com/ee/user/application_security/secret_detection/#customizing-settings
# Dependency Scanning customization: https://docs.gitlab.com/ee/user/application_security/dependency_scanning/#customizing-the-dependency-scanning-settings
# Container Scanning customization: https://docs.gitlab.com/ee/user/application_security/container_scanning/#customizing-the-container-scanning-settings
# Note that environment variables can be set in several places
# See https://docs.gitlab.com/ee/ci/variables/#cicd-variable-precedence

stages:
  - static
  - build
  - test

flawfinder-sast:
  stage: static
  needs: []
  dependencies: []

include:
- template: Security/SAST.gitlab-ci.yml

image: ubuntu:jammy

code_quality:
  stage: static
  allow_failure: true
  needs: []
  dependencies: []
  only:
    - main
    - merge_requests
  tags:
    - docker
  script:
    - DEBIAN_FRONTEND=noninteractive apt update && apt install -y python3 python3-pip cppcheck
    - python3 -m pip install -U cppcheck_codequality
    - cppcheck --xml --enable=warning,style,performance --std=c++14 --suppress=*:*catch.hpp --suppress=*:*loguru.cpp --suppress=*:*json.hpp ./ 2> cppcheck_out.xml
    - cppcheck-codequality --input-file=cppcheck_out.xml --output-file=cppcheck.json
  artifacts:
    reports:
      codequality: cppcheck.json

linux:build:
  only:
    - main
    - merge_requests
  
  stage: build
  tags:
    - docker

  script:
    - DEBIAN_FRONTEND=noninteractive apt update && apt install -y build-essential uuid-dev git libmsgpack-dev liburiparser-dev libgnutls28-dev cmake ninja-build cppcheck
    - mkdir build && cd build
    - cmake $CI_PROJECT_DIR -GNinja -DCMAKE_CXX_FLAGS="-fdiagnostics-color" -DUSE_CPPCHECK=TRUE -DCMAKE_BUILD_TYPE=Release -DCPACK_GENERATOR=DEB
    - ninja

  #cache:
  #  paths:
  #    - build/

  needs: []
  dependencies: []

  artifacts:
    name: ${CI_PROJECT_NAME}-${CI_COMMIT_SHORT_SHA}
    paths:
      - build/
    expire_in: 1 hour