~singpolyma/biboumi

7cc05ab4967e9fb77b6e4d8ca9800c8625895ad3 — louiz’ 6 years ago 24824a5
Refactor the CI file, build many configurations
2 files changed, 76 insertions(+), 18 deletions(-)

M .gitlab-ci.yml
M docker/biboumi-test/fedora/Dockerfile
M .gitlab-ci.yml => .gitlab-ci.yml +75 -17
@@ 1,44 1,102 @@
stages:
- build

before_script:
  - uname -a
  - whoami
  - echo $LANG
  - g++ --version
  - clang++ --version
  - mkdir build
  - rm -rf build/
  - mkdir build/
  - cd build

build:fedora:
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
  stage: build
  image: biboumi-test-fedora:latest
  script:
    - cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DWITH_BOTAN=1 -DWITH_CARES=1 -DWITH_SYSTEMD=1 -DWITH_LIBIDN=1 -DWITH_LITESQL=1
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
    - make biboumi -j$(nproc)
    - make coverage -j$(nproc)
    - make check -j$(nproc)
    - mkdir tests_outputs && pushd tests_outputs && make e2e -j$(nproc) -C .. && popd

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}
    - make rpm -j$(nproc)
  artifacts:
    paths:
      - build/coverage/
      - build/rpmbuild/RPMS
      - build/rpmbuild/SRPMS
      - build/tests_outputs/
    when: always

build:debian:
  stage: build
  image: biboumi-test-debian:latest

.template:basic_test: &basic_test
  stage: test
  script:
    - cmake .. -DCMAKE_CXX_COMPILER=g++ -DCMAKE_BUILD_TYPE=Debug -DWITH_BOTAN=1 -DWITH_CARES=1 -DWITH_SYSTEMD=1 -DWITH_LIBIDN=1 -DWITH_LITESQL=1
    - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}
    - make biboumi -j$(nproc)
    - make coverage -j$(nproc)
    - make check -j$(nproc)
    - make check
    - make coverage
    - mkdir tests_outputs && pushd tests_outputs && make e2e -j$(nproc) -C .. && popd
  artifacts:
    paths:
      - build/coverage/
      - build/tests_outputs/
    when: always

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

test:fedora:
  stage: test
  image: biboumi-test-fedora:latest
  <<: *basic_test
\ No newline at end of file

M docker/biboumi-test/fedora/Dockerfile => docker/biboumi-test/fedora/Dockerfile +1 -1
@@ 57,7 57,7 @@ RUN cd /charybdis && ./autogen.sh && ./configure --prefix=/home/tester/ircd --bi
RUN chown -R tester:tester /home/tester/ircd
RUN rm -rf /charybdis

RUN su - tester -c "echo export LANG=fr_FR.utf-8 >> /home/tester/.bashrc"
RUN su - tester -c "echo export LANG=en_GB.utf-8 >> /home/tester/.bashrc"

WORKDIR /home/tester
USER tester