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

11 12 13 14 15 16 17 18 19 20
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
21
  stage: build
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
    - make biboumi -j$(nproc)
louiz’'s avatar
louiz’ committed
26
    - make check -j$(nproc)
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 70 71 72

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
  script:
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
louiz’'s avatar
louiz’ committed
73
    - make rpm -j$(nproc)
louiz’'s avatar
louiz’ committed
74 75
  artifacts:
    paths:
76 77
      - build/rpmbuild/RPMS
      - build/rpmbuild/SRPMS
louiz’'s avatar
louiz’ committed
78
    when: always
79

80 81 82

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

test:debian:
  stage: test
  image: biboumi-test-debian:latest
  <<: *basic_test

test:fedora:
  stage: test
  image: biboumi-test-fedora:latest
104 105
  <<: *basic_test

louiz’'s avatar
louiz’ committed
106 107
test:openbsd:
  variables:
louiz’'s avatar
louiz’ committed
108
    COMPILER: "g++"
louiz’'s avatar
louiz’ committed
109 110 111 112 113 114
    SYSTEMD: "-DWITHOUT_SYSTEMD=1"
  stage: test
  tags:
    - openbsd
  <<: *basic_test

115 116 117 118 119 120 121 122 123
test:coverity:
  stage: test
  image: biboumi-test-fedora:latest
  script:
    - export PATH=$PATH:~/coverity/bin
    - cmake .. -DWITHOUT_SYSTEMD=1
    - cov-build --dir cov-int   make biboumi test_suite -j$(nproc)
    - 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