variables:
  GIT_STRATEGY: none
  GIT_SUBMODULE_STRATEGY: none

before_script:
 - |
    apt-get update -qq &&
    apt-get install -qq \
        autopoint \
        autoconf \
        automake \
        bison \
        build-essential \
        clang \
        cmake \
        curl \
        flex \
        fuse \
        genisoimage \
        git \
        gnupg \
        libfuse-dev \
        nasm \
        pkg-config \
        software-properties-common \
        syslinux \
        texinfo \
        wget &&
    apt-key adv -q --batch --yes --keyserver keyserver.ubuntu.com --recv-keys AA12E97F0881517F &&
    add-apt-repository 'deb https://static.redox-os.org/toolchain/apt ./' &&
    apt-get update -qq &&
    apt-get purge -qq binutils-doc &&
    apt-get install -qq x86-64-unknown-redox-gcc &&
    curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain none &&
    source "$HOME/.cargo/env" &&
    cargo install cargo-config xargo

build:
    script:
     - |
        [ -d "$CI_PROJECT_DIR" ] || git clone "$CI_BUILD_REPO" "$CI_PROJECT_DIR" &&
        cd "$CI_PROJECT_DIR" &&
        git remote set-url origin "$CI_BUILD_REPO" &&
        git fetch origin &&
        git checkout "$CI_BUILD_REF" &&
        git submodule update --init --recursive &&
        source "$HOME/.cargo/env" &&
        make ci
