image: obarun/base:latest

before_script:
  - pacman -Syu --noconfirm
  - pacman -S autoconf automake binutils bison file flex gcc gettext git grep groff libtool m4 make patch pkgconf texinfo which --noconfirm
  - pacman -S scdoc --noconfirm
  - ./build_toolchain.sh

test:
  stage: test
  script:
  - ./configure --bindir=/usr/bin --with-system-dir=/usr/lib/66/service
  - make
  - make install-html DESTDIR=gitlab-ci
  - make man
  - make install DESTDIR=gitlab-ci
  - make install-man DESTDIR=gitlab-ci
   
  only:
  - merge_requests


build:
  stage: build
  script:
  - ./configure --bindir=/usr/bin --with-system-dir=/usr/lib/66/service
  - make
  - make install-html DESTDIR=gitlab-ci
  - make man
  - make install DESTDIR=gitlab-ci
  - make install-man DESTDIR=gitlab-ci
  
  retry:
    max: 2
    
  only:
    refs:
      - master
    
