.gitlab-ci.yml 4.33 KB
Newer Older
louiz’'s avatar
louiz’ committed
1
before_script:
louiz’'s avatar
louiz’ committed
2
  - uname -a
3
  - locale
louiz’'s avatar
louiz’ committed
4
  - whoami
5 6
  - rm -rf build/
  - mkdir build/
7
  - cd build
louiz’'s avatar
louiz’ committed
8

9 10 11 12 13 14 15 16 17
variables:
  COMPILER: "g++"
  BUILD_TYPE: "Debug"
  BOTAN: "-DWITH_BOTAN=1"
  CARES: "-DWITH_CARES=1"
  SYSTEMD: "-DWITH_SYSTEMD=1"
  LIBIDN: "-DWITH_LIBIDN=1"
  LITESQL: "-DWITH_LITESQL=1"
.template:basic_build: &basic_build
louiz’'s avatar
louiz’ committed
18
  stage: build
19 20
  tags:
    - docker
21
  image: docker.louiz.org/biboumi-test-fedora:latest
louiz’'s avatar
louiz’ committed
22
  script:
23
    - "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}"
24
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
25 26
    - make biboumi -j$(nproc || echo 1)
    - make check -j$(nproc || echo 1)
27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68

build:1:
  variables:
    BOTAN: "-DWITHOUT_BOTAN=1"
  <<: *basic_build

build:2:
  variables:
    CARES: "-DWITHOUT_CARES=1"
  <<: *basic_build

build:3:
  variables:
    LITESQL: "-DWITHOUT_LITESQL=1"
  <<: *basic_build

build:4:
  variables:
    LITESQL: "-DWITHOUT_LITESQL=1"
    BOTAN: "-DWITHOUT_BOTAN=1"
  <<: *basic_build

build:5:
  variables:
    LITESQL: "-DWITHOUT_LITESQL=1"
    CARES: "-DWITHOUT_CARES=1"
  <<: *basic_build

build:6:
  variables:
    BOTAN: "-DWITHOUT_BOTAN=1"
    CARES: "-DWITHOUT_CARES=1"
  <<: *basic_build

build:6:
  variables:
    LIBIDN: "-DWITHOUT_LIBIDN=1"
    CARES: "-DWITHOUT_CARES=1"
  <<: *basic_build

build:rpm:
  stage: build
69 70
  only:
    - master@louiz/biboumi
71 72
  tags:
    - docker
73
  image: docker.louiz.org/biboumi-test-fedora:latest
74 75
  script:
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
76
    - make rpm -j$(nproc || echo 1)
louiz’'s avatar
louiz’ committed
77 78
  artifacts:
    paths:
79 80
      - build/rpmbuild/RPMS
      - build/rpmbuild/SRPMS
louiz’'s avatar
louiz’ committed
81
    when: always
82
    name: $CI_PROJECT_NAME-rpm-$CI_BUILD_ID
83

84 85 86

.template:basic_test: &basic_test
  stage: test
87 88
  tags:
    - docker
89
  script:
90
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
91
    - make biboumi -j$(nproc || echo 1)
92 93
    - make coverage_check -j$(nproc || echo 1)
    - make coverage_e2e -j$(nproc || echo 1)
94
    - make coverage
95 96
    - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -f ./coverage_e2e.info -F integration
    - bash <(curl -s https://codecov.io/bash) -X gcov -X coveragepy -f ./coverage_test_suite.info -F unittests
97 98
  artifacts:
    paths:
99
      - build/coverage_test_suite/
100
      - build/coverage_e2e/
101
      - build/coverage_total/
louiz’'s avatar
louiz’ committed
102
    when: always
louiz’'s avatar
louiz’ committed
103
    name: $CI_PROJECT_NAME-test-$CI_BUILD_ID
104 105

test:debian:
106
  image: docker.louiz.org/biboumi-test-debian:latest
107 108 109
  <<: *basic_test

test:fedora:
110
  image: docker.louiz.org/biboumi-test-fedora:latest
111 112
  <<: *basic_test

louiz’'s avatar
louiz’ committed
113
test:freebsd:
114 115
  only:
    - master@louiz/biboumi
louiz’'s avatar
louiz’ committed
116 117 118 119 120 121
  tags:
    - freebsd
  variables:
    SYSTEMD: "-DWITHOUT_SYSTEMD=1"
  stage: test
  script:
122
    - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
123 124 125 126
    - make biboumi
    - make check
    - make e2e

127 128
test:coverity:
  stage: test
129 130
  only:
    - master@louiz/biboumi
131 132
  tags:
    - docker
133
  image: docker.louiz.org/biboumi-test-fedora:latest
134 135
  allow_failure: true
  when: manual
136 137 138
  script:
    - export PATH=$PATH:~/coverity/bin
    - cmake .. -DWITHOUT_SYSTEMD=1
louiz’'s avatar
louiz’ committed
139
    - cov-build --dir cov-int   make biboumi test_suite -j$(nproc || echo 1)
140 141
    - tar czvf biboumi_coverity.tgz cov-int
    - curl --form token=$COVERITY_TOKEN   --form email=louiz@louiz.org   --form file=@biboumi_coverity.tgz  --form version="$(git rev-parse --short HEAD)" --form description="Automatic submission by gitlab-ci" https://scan.coverity.com/builds?project=louiz%2Fbiboumi
142 143 144

test:sonar-qube:
  stage: test
145 146
  only:
    - master@louiz/biboumi
147 148
  tags:
    - docker
149
  image: docker.louiz.org/biboumi-test-fedora:latest
150
  allow_failure: true
151 152 153
  script:
    - cmake ..
    - ~/sonar-scanner/bin/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir ./bw-outputs make biboumi test_suite
louiz’'s avatar
louiz’ committed
154
    - cd ..
louiz’'s avatar
louiz’ committed
155
    - ~/sonar-scanner/bin/sonar-scanner -Dsonar.host.url=https://sonarqube.com -Dsonar.login=$SONAR_LOGIN -Dsonar.language=cpp -Dsonar.cfamily.build-wrapper-output=build/bw-outputs -Dsonar.sourceEncoding=UTF-8 -Dsonar.sources=src/,louloulibs/,tests/ -Dsonar.projectKey=biboumi -Dsonar.projectName=Biboumi -Dsonar.projectVersion=3.0