.gitlab-ci.yml 4.06 KB
Newer Older
louiz’'s avatar
louiz’ committed
1
before_script:
louiz’'s avatar
louiz’ committed
2 3
  - uname -a
  - whoami
4 5
  - export LC_ALL=C.UTF-8
  - export LANG=C.UTF-8
louiz’'s avatar
louiz’ committed
6
  - echo $LANG
louiz’'s avatar
louiz’ committed
7 8
  - g++ --version
  - clang++ --version
9 10
  - rm -rf build/
  - mkdir build/
11
  - cd build
louiz’'s avatar
louiz’ committed
12

13 14 15 16 17 18 19 20 21 22
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
23
  stage: build
louiz’'s avatar
louiz’ committed
24
  script:
25
    - "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}"
26
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
27 28
    - make biboumi -j$(nproc || echo 1)
    - make check -j$(nproc || echo 1)
29 30
  tags:
    - docker
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 70 71 72 73 74

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

88 89 90

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

test:debian:
  stage: test
  image: biboumi-test-debian:latest
108 109
  tags:
    - docker
110 111 112 113 114
  <<: *basic_test

test:fedora:
  stage: test
  image: biboumi-test-fedora:latest
115 116
  tags:
    - docker
117 118
  <<: *basic_test

louiz’'s avatar
louiz’ committed
119 120
test:openbsd:
  variables:
louiz’'s avatar
louiz’ committed
121
    COMPILER: "g++"
louiz’'s avatar
louiz’ committed
122 123
    SYSTEMD: "-DWITHOUT_SYSTEMD=1"
  stage: test
124 125 126 127
  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
128 129 130
  tags:
    - openbsd

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

test:sonar-qube:
  stage: test
  image: biboumi-test-fedora:latest
148 149
  tags:
    - docker
150 151 152
  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
153
    - cd ..
louiz’'s avatar
louiz’ committed
154
    - ~/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
155