stages: - build # Build in various conf, keeps the artifacts - test # Use the build artifacts to run the tests - packaging # Publish some packages (rpm, deb…) - deploy # Deploy things like the web doc - external # Interact with some external service (coverity…) before_script: - uname -a - whoami variables: COMPILER: "g++" BUILD_TYPE: "Debug" BOTAN: "-DWITH_BOTAN=1" UDNS: "-DWITH_UDNS=1" SYSTEMD: "-DWITH_SYSTEMD=1" LIBIDN: "-DWITH_LIBIDN=1" SQLITE3: "-DWITH_SQLITE3=1" POSTGRESQL: "-WITH_POSTGRESQL=1" # ## Build jobs # .sources_changed: only: changes: - "CMakeLists.txt" - ".gitlab-ci.yml" - "src/**/*" - "tests/**/*" .basic_build: extends: .sources_changed stage: build tags: - docker script: - "echo Running cmake with the following parameters: -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3} ${POSTGRESQL}" - mkdir build/ - cd build/ - cmake .. -DCMAKE_CXX_FLAGS="-Werror -Wno-psabi" -DCMAKE_CXX_COMPILER=${COMPILER} -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3} ${POSTGRESQL} - make everything -j$(nproc || echo 1) artifacts: expire_in: 2 weeks paths: - build/ .fedora_build: extends: .basic_build image: docker.louiz.org/louiz/biboumi/test-fedora:latest build:fedora: extends: .fedora_build build:debian: extends: .basic_build image: docker.louiz.org/louiz/biboumi/test-debian:latest build:alpine: extends: .basic_build variables: SYSTEMD: "-DWITHOUT_SYSTEMD=1" image: docker.louiz.org/louiz/biboumi/test-alpine:latest build:archlinux: extends: .basic_build only: - branches@louiz/biboumi - triggers tags: - armv7l artifacts: paths: [] build:no_botan: extends: .fedora_build variables: BOTAN: "-DWITHOUT_BOTAN=1" build:no_udns: extends: .fedora_build variables: UDNS: "-DWITHOUT_UDNS=1" build:no_libidn: extends: .fedora_build variables: UDNS: "-DWITHOUT_UDNS=1" build:no_sqlite3: extends: .fedora_build variables: SQLITE3: "-DWITHOUT_SQLITE3=1" TEST_POSTGRES_URI: "postgres@postgres/postgres" services: - postgres:latest build:no_db: extends: .fedora_build variables: SQLITE3: "-DWITHOUT_SQLITE3=1" POSTGRESQL: "-DWITHOUT_POSTGRESQL=1" build:no_db_botan: extends: .fedora_build variables: SQLITE3: "-DWITHOUT_SQLITE3=1" POSTGRESQL: "-DWITHOUT_POSTGRESQL=1" BOTAN: "-DWITHOUT_BOTAN=1" # ## Test jobs # .basic_test: extends: .sources_changed stage: test tags: - docker script: - cd build/ - make check -j$(nproc || echo 1) - make e2e -j$(nproc || echo 1) test:debian: extends: .basic_test image: docker.louiz.org/louiz/biboumi/test-debian:latest dependencies: - build:debian needs: ["build:debian"] test:fedora: extends: .basic_test image: docker.louiz.org/louiz/biboumi/test-fedora:latest script: - cd build/ - make coverage_check -j$(nproc || echo 1) - make coverage_e2e -j$(nproc || echo 1) - make coverage dependencies: - build:fedora needs: ["build:fedora"] artifacts: expire_in: 2 weeks paths: - build/coverage_test_suite/ - build/coverage_e2e/ - build/coverage_total/ - build/coverage_e2e.info when: always name: $CI_PROJECT_NAME-test-$CI_JOB_ID test:no_udns: extends: .basic_test image: docker.louiz.org/louiz/biboumi/test-fedora:latest dependencies: - build:no_udns needs: ["build:no_udns"] test:alpine: extends: .basic_test image: docker.louiz.org/louiz/biboumi/test-alpine:latest dependencies: - build:alpine needs: ["build:alpine"] image: docker.louiz.org/louiz/biboumi/test-alpine:latest test:freebsd: tags: - freebsd only: - branches@louiz/biboumi variables: GIT_STRATEGY: "clone" SYSTEMD: "-DWITHOUT_SYSTEMD=1" stage: test script: - mkdir build/ - cd build/ - cmake .. -DCMAKE_CXX_FLAGS="-Werror" -DCMAKE_BUILD_TYPE=${BUILD_TYPE} ${BOTAN} ${UDNS} ${SYSTEMD} ${LIBIDN} ${SQLITE3} - make check - make e2e dependencies: [] needs: [] # ## Packaging jobs # packaging:rpm: stage: packaging only: - master@louiz/biboumi tags: - docker allow_failure: true image: docker.louiz.org/louiz/biboumi/test-fedora:latest script: - cd build/ - make rpm -j$(nproc || echo 1) artifacts: paths: - build/rpmbuild/RPMS - build/rpmbuild/SRPMS when: always name: $CI_PROJECT_NAME-rpm-$CI_BUILD_ID dependencies: - build:fedora packaging:deb: stage: packaging only: - master@louiz/biboumi - debian@louiz/biboumi tags: - docker allow_failure: true image: docker.louiz.org/louiz/biboumi/packaging-debian:latest before_script: [] script: - git checkout debian - git pull - git merge --no-commit --no-ff master - mk-build-deps - apt update -y - apt install -y ./biboumi-build-deps*.deb - debuild -b -us -uc - mv ../*.deb . - mv ../*.build . - mv ../*.buildinfo . dependencies: [] artifacts: untracked: true name: $CI_PROJECT_NAME-deb-$CI_BUILD_ID packaging:archlinux: stage: packaging only: - master@louiz/biboumi tags: - docker allow_failure: true image: docker.louiz.org/louiz/biboumi/packaging-archlinux:latest before_script: [] script: - sudo pacman -Syuu --noconfirm - git clone https://aur.archlinux.org/biboumi-git.git - cd biboumi-git - makepkg -si --noconfirm - test -e /usr/bin/biboumi dependencies: [] # # Deploy jobs # .doc_changed: only: changes: - "CMakeLists.txt" - ".gitlab-ci.yml" - "doc/**/*" # The jobs with the secure tag need to access directories where important # files are stored: the latest doc, etc.' # Other jobs can not access these, otherwise anybody doing a merge request # could delete the official doc .deploy:doc: extends: .doc_changed stage: deploy image: docker.louiz.org/louiz/biboumi/doc-builder script: - cd doc/ - make html - rm -rf /www/$DOC_DEPLOY_DIR - mv _build/html /www/$DOC_DEPLOY_DIR dependencies: [] deploy:doc:latest: extends: .deploy:doc only: - master@louiz/biboumi tags: - www - secure environment: name: doc.latest url: https://doc.biboumi.louiz.org variables: DOC_DEPLOY_DIR: "latest" deploy:doc:tag: extends: .deploy:doc only: - tags tags: - www - secure environment: name: doc.$CI_COMMIT_TAG url: https://doc.biboumi.louiz.org/$CI_COMMIT_TAG/ variables: DOC_DEPLOY_DIR: $CI_COMMIT_TAG deploy:doc:mr: extends: .deploy:doc only: - merge_requests tags: - www - unsecure environment: name: doc.mr.$CI_MERGE_REQUEST_ID url: https://doc.biboumi.louiz.org/mr/$CI_MERGE_REQUEST_ID/ on_stop: undeploy:doc:mr variables: DOC_DEPLOY_DIR: $CI_MERGE_REQUEST_ID undeploy:doc:mr: stage: deploy tags: - www - unsecure only: - merge_requests image: docker.louiz.org/louiz/biboumi/doc-builder variables: GIT_STRATEGY: none when: manual environment: name: doc.mr.$CI_MERGE_REQUEST_ID action: stop script: - rm -rf /www/$CI_MERGE_REQUEST_ID dependencies: []