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

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
louiz’'s avatar
louiz’ committed
19
  script:
20
    - "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}"
21
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
22 23
    - make biboumi -j$(nproc || echo 1)
    - make check -j$(nproc || echo 1)
24 25
  tags:
    - docker
26 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 69

image: biboumi-test-fedora:latest

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

83 84 85

.template:basic_test: &basic_test
  stage: test
86
  script:
87
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
88
    - make biboumi -j$(nproc || echo 1)
89 90
    - make check
    - make coverage
louiz’'s avatar
louiz’ committed
91
    - mkdir tests_outputs && pushd tests_outputs && make coverage_e2e -j$(nproc || echo 1) -C .. && popd
92 93 94
  artifacts:
    paths:
      - build/coverage/
95
      - build/coverage_e2e/
louiz’'s avatar
louiz’ committed
96 97
      - build/tests_outputs/
    when: always
louiz’'s avatar
louiz’ committed
98
    name: $CI_PROJECT_NAME-test-$CI_BUILD_ID
99 100 101 102

test:debian:
  stage: test
  image: biboumi-test-debian:latest
103 104
  tags:
    - docker
105 106 107 108 109
  <<: *basic_test

test:fedora:
  stage: test
  image: biboumi-test-fedora:latest
110 111
  tags:
    - docker
112 113
  <<: *basic_test

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

louiz’'s avatar
louiz’ committed
127 128
test:openbsd:
  variables:
louiz’'s avatar
louiz’ committed
129
    COMPILER: "g++"
louiz’'s avatar
louiz’ committed
130 131
    SYSTEMD: "-DWITHOUT_SYSTEMD=1"
  stage: test
132 133 134 135
  script:
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
    - make biboumi
    - make check
louiz’'s avatar
louiz’ committed
136 137 138
  tags:
    - openbsd

139 140 141
test:coverity:
  stage: test
  image: biboumi-test-fedora:latest
142 143
  tags:
    - docker
144 145
  allow_failure: true
  when: manual
146 147 148
  script:
    - export PATH=$PATH:~/coverity/bin
    - cmake .. -DWITHOUT_SYSTEMD=1
louiz’'s avatar
louiz’ committed
149
    - cov-build --dir cov-int   make biboumi test_suite -j$(nproc || echo 1)
150 151
    - 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
152 153 154 155

test:sonar-qube:
  stage: test
  image: biboumi-test-fedora:latest
156 157
  tags:
    - docker
158 159 160
  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
161
    - cd ..
louiz’'s avatar
louiz’ committed
162
    - ~/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
louiz’'s avatar
louiz’ committed
163