From dac2119777f46ffdd238e2ee1dd3c09c10892172 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?louiz=E2=80=99?= Date: Thu, 8 Dec 2016 00:56:26 +0100 Subject: CI: refactor, and enable some specific test only on the master project Because some of the jobs (the one using ssh runners, freebsd and openbsd) use runners that are only available on my own project and not forks (for security reasons), and some other jobs (coverity and sonar-qube) use private variables to be able to run. So, all these jobs would fail if run on a fork project. --- .gitlab-ci.yml | 42 ++++++++++++++++++++++-------------------- 1 file changed, 22 insertions(+), 20 deletions(-) diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index d69d302..26b22ac 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -13,18 +13,16 @@ variables: SYSTEMD: "-DWITH_SYSTEMD=1" LIBIDN: "-DWITH_LIBIDN=1" LITESQL: "-DWITH_LITESQL=1" - .template:basic_build: &basic_build stage: build + tags: + - docker + image: biboumi-test-fedora:latest script: - "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL}" - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL} - make biboumi -j$(nproc || echo 1) - make check -j$(nproc || echo 1) - tags: - - docker - -image: biboumi-test-fedora:latest build:1: variables: @@ -67,9 +65,11 @@ build:6: build:rpm: stage: build - image: biboumi-test-fedora:latest + only: + - master@louiz/biboumi tags: - docker + image: biboumi-test-fedora:latest script: - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL} - make rpm -j$(nproc || echo 1) @@ -83,6 +83,8 @@ build:rpm: .template:basic_test: &basic_test stage: test + tags: + - docker script: - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL} - make biboumi -j$(nproc || echo 1) @@ -98,49 +100,48 @@ build:rpm: name: $CI_PROJECT_NAME-test-$CI_BUILD_ID test:debian: - stage: test image: biboumi-test-debian:latest - tags: - - docker <<: *basic_test test:fedora: - stage: test image: biboumi-test-fedora:latest - tags: - - docker <<: *basic_test test:freebsd: + only: + - master@louiz/biboumi tags: - freebsd variables: - COMPILER: "clang++" SYSTEMD: "-DWITHOUT_SYSTEMD=1" stage: test script: - - cmake .. -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL} + - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${CARES} ${SYSTEMD} ${LIBIDN} ${LITESQL} - make biboumi - make check - make e2e test:openbsd: + stage: test + only: + - master@louiz/biboumi + tags: + - openbsd variables: COMPILER: "g++" 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 - tags: - - openbsd test:coverity: stage: test - image: biboumi-test-fedora:latest + only: + - master@louiz/biboumi tags: - docker + image: biboumi-test-fedora:latest allow_failure: true when: manual script: @@ -152,12 +153,13 @@ test:coverity: test:sonar-qube: stage: test - image: biboumi-test-fedora:latest + only: + - master@louiz/biboumi tags: - docker + image: biboumi-test-fedora:latest script: - cmake .. - ~/sonar-scanner/bin/build-wrapper-linux-x86/build-wrapper-linux-x86-64 --out-dir ./bw-outputs make biboumi test_suite - cd .. - ~/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 - -- cgit v1.2.3