.gitlab-ci.yml 4.21 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 21
  tags:
    - docker
  image: 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: 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 check
    - make coverage
louiz’'s avatar
louiz’ committed
94
    - mkdir tests_outputs && pushd tests_outputs && make coverage_e2e -j$(nproc || echo 1) -C .. && popd
95
    - if [ ! -z $COVERALLS_TOKEN -a ! -z $UPLOAD_TO_COVERALLS ]; then coveralls-lcov --repo-token $COVERALLS_TOKEN coverage_e2e.info.cleaned; fi
96 97 98
  artifacts:
    paths:
      - build/coverage/
99
      - build/coverage_e2e/
louiz’'s avatar
louiz’ committed
100 101
      - build/tests_outputs/
    when: always
louiz’'s avatar
louiz’ committed
102
    name: $CI_PROJECT_NAME-test-$CI_BUILD_ID
103 104

test:debian:
105 106
  variables:
    UPLOAD_TO_COVERALLS: "true"
107 108 109 110 111
  image: biboumi-test-debian:latest
  <<: *basic_test

test:fedora:
  image: biboumi-test-fedora:latest
112 113
  <<: *basic_test

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

128 129
test:coverity:
  stage: test
130 131
  only:
    - master@louiz/biboumi
132 133
  tags:
    - docker
134
  image: biboumi-test-fedora:latest
135 136
  allow_failure: true
  when: manual
137 138 139
  script:
    - export PATH=$PATH:~/coverity/bin
    - cmake .. -DWITHOUT_SYSTEMD=1
louiz’'s avatar
louiz’ committed
140
    - cov-build --dir cov-int   make biboumi test_suite -j$(nproc || echo 1)
141 142
    - 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
143 144 145

test:sonar-qube:
  stage: test
146 147
  only:
    - master@louiz/biboumi
148 149
  tags:
    - docker
150
  image: biboumi-test-fedora:latest
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