spot/.gitlab-ci.yml
Antoine Martin 3c12015181 build rpm package during ci
* .gitignore: don't commit spot.spec
* Makefile.am: write version number to spot.spec.in
* .gitlab-ci.yml: new job builds the tarball and rpm package
* spot.spec.in: spot.spec is used by rpmbuild to build the package
2018-06-29 13:29:15 +02:00

254 lines
6.8 KiB
YAML

stages:
- build
- publish
debian-stable-gcc:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-debuild:stable
script:
- autoreconf -vfi
- ./configure --enable-max-accsets=256
- make
- make distcheck
artifacts:
when: always
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
- ./*.tar.gz
debian-unstable-gcc-coverage:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-debuild
script:
- autoreconf -vfi
- ./configure CXX='g++ --coverage' --enable-devel --disable-static --enable-doxygen
- make
- make check
- lcov --capture --directory . --no-external --output spot.info
- lcov --remove spot.info '*/bin/spot.cc' '*/bin/spot-x.cc' '*/spot/parse*/scan*.cc' '*/spot/parse*/parse*.cc' '*/utf8/*' '*/python/*' '*/buddy/*' '*/doc/org/tmp/*' --output spot2.info
- lcov --summary spot2.info
- genhtml --legend --demangle-cpp --output-directory coverage spot2.info
artifacts:
when: always
paths:
- tests/*/*.log
- ./*.log
- doc/spot.html/
- doc/userdoc/
- coverage/
- ./*.tar.gz
- spot2.info
debian-gcc-snapshot:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-debuild
script:
- export PATH="/usr/lib/gcc-snapshot/bin:$PATH" LD_LIBRARY_PATH="/usr/lib/gcc-snapshot/lib:$LD_LIBRARY_PATH"
- autoreconf -vfi
- ./configure CXX='g++'
- make
- make distcheck
artifacts:
when: always
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
- doc/spot.html/
- doc/userdoc/
- ./*.tar.gz
arch-clang:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-arch
script:
- autoreconf -vfi
- ./configure --prefix ~/install_dir CC='clang -Qunused-arguments' CXX='clang++ -Qunused-arguments' --enable-devel --enable-c++17 --enable-doxygen
- make
- make distcheck
artifacts:
when: on_failure
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
arch-gcc-glibcxxdebug:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-arch
script:
- env
- autoreconf -vfi
- ./configure --enable-devel --enable-c++17 --enable-glibcxx-debug
- make
- make distcheck
artifacts:
when: on_failure
paths:
- ./spot-*/_build/sub/tests/*/*.log
- ./*.log
mingw-shared:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-debuild
script:
- autoreconf -vfi
- ./configure CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++-posix --host i686-w64-mingw32 --disable-python
- touch doc/org-stamp
- make
artifacts:
when: on_failure
paths:
- tests/*/*.log
- ./*.log
mingw-static:
stage: build
only:
- branches
except:
- /wip/
image: registry.lrde.epita.fr/spot-debuild
script:
- mkdir install_dir
- autoreconf -vfi
- ./configure CC=i686-w64-mingw32-gcc CXX=i686-w64-mingw32-g++-posix --host i686-w64-mingw32 --disable-python --disable-shared --enable-optimizations --disable-devel LDFLAGS='-static-libgcc -static-libstdc++ -Wl,-Bstatic,--whole-archive -Wl,-lwinpthread -Wl,--no-whole-archive' --prefix=/usr
- touch doc/org-stamp
- make
- make install-exec DESTDIR=$PWD/install_dir
- VERSION=`autoconf --trace='AC_INIT:$2'`
- cd install_dir
- i686-w64-mingw32-strip usr/bin/*
- tar cfvz ../spot-${VERSION}-${CI_COMMIT_REF_SLUG}-bin.tar.gz *
artifacts:
when: always
paths:
- tests/*/*.log
- ./*.log
- ./*.tar.gz
debpkg-stable:
stage: build
only:
- /-deb$/
- master
- next
- stable
script:
- docker pull registry.lrde.epita.fr/spot-debuild:stable
- docker pull registry.lrde.epita.fr/spot-debuild-i386:stable
- vol=spot-stable-$CI_COMMIT_SHA
- docker volume create $vol
- exitcode=0
- docker run --rm=true -v $vol:/build/result gadl/spot-debuild:stable ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker run --rm=true -v $vol:/build/result gadl/spot-debuild-i386:stable ./bin-spot.sh -j${NBPROC-1} || exitcode=$
- docker run -v $vol:/build/result --name helper-$vol gadl/spot-debuild:stable true || exitcode=$?
- docker cp helper-$vol:/build/result _build_stable || exitcode=$?
- docker rm helper-$vol || exitcode=$?
- docker volume rm $vol || exitcode=$?
- ls -l _build_stable
- exit $exitcode
artifacts:
when: always
paths:
- _build_stable/
debpkg-unstable:
stage: build
only:
- /-deb$/
- next
script:
- docker pull registry.lrde.epita.fr/spot-debuild
- docker pull registry.lrde.epita.fr/spot-debuild-i386
- vol=spot-unstable-$CI_COMMIT_SHA
- docker volume create $vol
- exitcode=0
- docker run --rm=true -v $vol:/build/result gadl/spot-debuild ./build-spot.sh $CI_COMMIT_REF_NAME -j${NBPROC-1} || exitcode=$?
- docker run --rm=true -v $vol:/build/result gadl/spot-debuild-i386 ./bin-spot.sh -j${NBPROC-1} || exitcode=$?
- docker run -v $vol:/build/result --name helper-$vol gadl/spot-debuild true || exitcode=$?
- docker cp helper-$vol:/build/result _build_unstable || exitcode=$?
- docker rm helper-$vol || exitcode=$?
- docker volume rm $vol || exitcode=$?
- ls -l _build_unstable
- exit $exitcode
artifacts:
when: always
paths:
- _build_unstable/
rpm-pkg:
stage: build
only:
- /-rpm$/
- master
- next
- stable
image: registry.lrde.epita.fr/spot-rpm
script:
- autoreconf -vfi
- ./configure
- make
- make dist
- cp spot-*.tar.gz ~/rpmbuild/SOURCES/
- cp spot.spec ~/rpmbuild/SPECS/
- rpmbuild -bb ~/rpmbuild/SPECS/spot.spec
- mv ~/rpmbuild/RPMS/x86_64/*.rpm .
artifacts:
when: always
paths:
- ./*.rpm
publish-stable:
only:
- stable
tags:
- dput
stage: publish
dependencies:
- debpkg-stable
script:
- cd _build_stable
- ls -l
- dput lrde *.changes
- tgz=`ls spot-*.tar.* | head -n 1`
- case $tgz in *[0-9].tar.*) scp $tgz doc@perso:/var/www/dload/spot/;; esac
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=stable" https://gitlab.lrde.epita.fr/api/v4/projects/131/trigger/pipeline
publish-unstable:
only:
- next
tags:
- dput
stage: publish
dependencies:
- debpkg-unstable
script:
- cd _build_unstable
- ls -l
- dput lrde *.changes
- curl -X POST -F ref=master -F token=$TRIGGER_SPOT_WEB -F "variables[spot_branch]=next" https://gitlab.lrde.epita.fr/api/v4/projects/131/trigger/pipeline
- curl -X POST -F ref=master -F token=$TRIGGER_SANDBOX https://gitlab.lrde.epita.fr/api/v4/projects/181/trigger/pipeline