stages:
  - testing
  - dist

alpine-amd64:
  stage: testing
  image: alpine:latest
  script:
    - apk add libcurl gcc make pkgconf musl-dev curl-dev flex bison libbsd-dev perl 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:latest
  script:
    - apk add libcurl gcc make pkgconf musl-dev curl-dev flex bison xz gzip bzip2 libbsd-dev perl 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:trixie
  script:
    - apt-get update
    - apt-get install -y --no-install-recommends build-essential libcurl4-openssl-dev pkgconf bison flex make libbsd-dev perl libreadline-dev libssl-dev git
    - ./configure --debug
    - make -j all
    - make -j distcheck
