stages:
  - testing
  - dist

alpine-amd64:
  stage: testing
  image: alpine:3.17
  script:
    - apk add libcurl gcc make pkgconf musl-dev curl-dev flex bison libbsd-dev kyua atf-dev libedit-dev git
    - ./configure --debug
    - make -j all
    - make -j distcheck

freebsd-arm64:
  stage: testing
  tags:
    - freebsd
    - arm64
  script:
    - ./configure --debug
    - make -j 4 all
    - make -j 4 distcheck

freebsd-riscv64:
  stage: testing
  tags:
    - freebsd
    - riscv
  script:
    - ./configure --debug
    - make -j 4 all
    - make -j 4 distcheck

dist:
  stage: dist
  image: alpine:3.18
  script:
    - apk add libcurl gcc make pkgconf musl-dev curl-dev flex bison xz gzip bzip2 libbsd-dev kyua atf-dev cmark git
    - ./configure --debug
    - (cd docs/website && ./deploy.sh)
    - tools/gentarball.sh
  artifacts:
    name: "Dist Tarballs"
    paths:
      - dist/gcli-*/*
      - docs/website/website_dist.tar.xz

debian-amd64:
  stage: testing
  image: debian:bookworm
  script:
    - apt-get update
    - apt-get install -y --no-install-recommends build-essential libcurl4-openssl-dev pkgconf bison flex make libbsd-dev libatf-dev kyua libreadline-dev libssl-dev git
    - ./configure --debug
    - make -j all
    - make -j distcheck
