1# .gitlab-ci.yml -- to test some source code build scenarios 2# Copyright (C) 2016-2020 Olaf Meeuwissen 3# 4# License: GPL-3.0+ 5 6variables: 7 REGISTRY_HUB: "registry.gitlab.com/sane-project/ci-envs" 8 CONFIGURE_MINI: "--enable-silent-rules" 9 CONFIGURE_FULL: "--with-usb --with-usb-record-replay --with-avahi --enable-pnm-backend --with-libcurl --with-poppler-glib" 10 11stages: 12 - tarball 13 - compile 14 - snapshot 15 - release 16 17# This job creates the source tarball that is the *sole* input to our 18# compile stage. The job is meant to be run on the stable release of 19# Debian GNU/Linux. 20 21make-dist: 22 image: $REGISTRY_HUB:debian-bullseye-mini 23 stage: tarball 24 script: 25 - git ls-files | xargs ./tools/style-check.sh 26 - ./autogen.sh 27 - ./tools/create-changelog.sh 28 - ./configure 29 - make dist 30 artifacts: 31 paths: 32 - sane-backends-*.tar.gz 33 expire_in: 1 day 34 35.compile_template: &compile_definition 36 stage: compile 37 script: 38 - mkdir build 39 - cd build 40 - tar xzf ../sane-backends-*.tar.gz --strip-components=1 41 - (set -x; ./configure $CONFIGURE_OPTS) 42 - eval "(set -x; make -j2 -k $MAKE_FLAGS)" 43 44debian-10-full: 45 image: $REGISTRY_HUB:debian-buster-full 46 variables: 47 CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" 48 MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror" 49 <<: *compile_definition 50 51debian-11-mini: 52 image: $REGISTRY_HUB:debian-bullseye-mini 53 variables: 54 CONFIGURE_OPTS: "$CONFIGURE_MINI" 55 MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror" 56 <<: *compile_definition 57 58# In addition to the regular compile check, the full Debian stable 59# environment is used to keep some of the HTML documentation that's 60# available from our website up-to-date. 61 62debian-11-full: 63 image: $REGISTRY_HUB:debian-bullseye-full 64 variables: 65 CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" 66 MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror" 67 <<: *compile_definition 68 after_script: 69 - make -C build/doc html-pages 70 - rm -rf lists && mkdir lists && mv build/doc/*.html lists/ 71 - cd build/doc && doxygen doxygen-sanei.conf && mv sanei-html ../../doc 72 artifacts: 73 paths: 74 - sane-backends-*.tar.gz 75 - lists 76 - doc/sanei-html 77 expire_in: 1 day 78 79fedora-36-clang: 80 image: $REGISTRY_HUB:fedora-36-clang 81 variables: 82 CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" 83 MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror" 84 <<: *compile_definition 85 86alpine-3.15-musl: 87 image: $REGISTRY_HUB:alpine-3.15-musl 88 variables: 89 CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" 90 MAKE_FLAGS: "CFLAGS='-Werror -Wno-pedantic' CXXFLAGS=-Werror" 91 <<: *compile_definition 92 93ubuntu-22.04-lts: 94 image: $REGISTRY_HUB:ubuntu-jammy-dist 95 variables: 96 CONFIGURE_OPTS: "$CONFIGURE_MINI $CONFIGURE_FULL" 97 MAKE_FLAGS: "CFLAGS=-Werror CXXFLAGS=-Werror" 98 <<: *compile_definition 99 100# This snapshot stage job makes sure that the source tarball has all 101# it needs to rebuild itself, install everything built and cleans up 102# without leaving any droppings behind when uninstalling. The build 103# result will be available as a snapshot for a limited time period. 104# People that prefer a source tarball to work with should use this 105# snapshot. 106# Some HTML documentation derived from this project's source is also 107# uploaded for use by our website so it uses the latest information. 108# It gets these artifacts from the full compile job on Debian stable, 109# hence the dependency. 110 111make-distcheck: 112 image: $REGISTRY_HUB:debian-bullseye-full 113 stage: snapshot 114 dependencies: 115 - debian-11-full 116 script: 117 - tar xzf sane-backends-*.tar.gz --strip-components=1 118 - rm sane-backends-*.tar.gz 119 - ./configure 120 - make distcheck 121 artifacts: 122 paths: 123 - sane-backends-*.tar.gz 124 - lists 125 - doc/sanei-html 126 expire_in: 90 days 127 128# For release tags only, this manual job handles putting all of the 129# releasables on the Project Releases page. See the script for more 130# details. 131 132upload: 133 image: alpine 134 stage: release 135 before_script: 136 - apk --no-cache add curl git jq 137 script: 138 - ./tools/create-release.sh 139 only: 140 - tags 141 when: manual 142 variables: 143 GIT_DEPTH: "3" 144 allow_failure: false 145