image: cznic/ubuntu:16.04

variables:
  DEBIAN_FRONTEND: noninteractive
  LC_ALL: C.UTF-8
  
build:linux:amd64:
  stage: build
  script:
    - PREFIX=$(pwd)/.local make -k all
    - PREFIX=$(pwd)/.local make install
  artifacts:
    untracked: true
  tags:
    - docker
    - linux
    - amd64

test:linux:amd64:
  stage: test
  script:
    - PREFIX=$(pwd)/.local make -k check
  dependencies:
    - build:linux:amd64
  tags:
    - docker
    - linux
    - amd64

deckard:linux:amd64:
  stage: test
  before_script:
    - git submodule update --init --recursive
  script:
    - mkdir -p tests/deckard/contrib/libswrap/obj
    - MAKEFLAGS="-j $(nproc)" LD_LIBRARY_PATH=$(pwd)/.local/lib TESTS=sets/resolver DAEMON=$(pwd)/.local/sbin/kresd tests/deckard/kresd_run.sh
  dependencies:
    - build:linux:amd64
  tags:
    - docker
    - linux
    - amd64

#arm_build:
#  image: cznic/armhf-ubuntu:16.04
#  stage: build
#  script:
#    - make -k all
#  tags:
#    - docker
#    - linux
#    - arm

#arm_test:
#  image: armv7/armhf-ubuntu:16.04
#  stage: test
#  script:
#    - make -k check
#  tags:
#    - docker
#    - linux
#    - arm
