image: registry.salsa.debian.org/salsa-ci-team/pipeline/base:unstable

shellcheck:
  stage: test
  script:
    - apt-get update
    - apt-get dist-upgrade --yes
    - apt-get --no-install-recommends --yes install shellcheck
    - shellcheck debvm-*

codespell:
  stage: test
  script:
    - apt-get update
    - apt-get dist-upgrade --yes
    - apt-get --no-install-recommends --yes install codespell
    - codespell debvm-*

simpletest:
  stage: test
  script:
    - apt-get update
    - apt-get dist-upgrade --yes
    - apt-get --no-install-recommends --yes install e2fsprogs genext2fs mmdebstrap openssh-client qemu-kvm timelimit
    - ssh-keygen -f ~/.ssh/id -N ''
    - ./debvm-create -k ~/.ssh/id.pub -r unstable
    - timelimit -t 120 -T 10 ./debvm-run -s 2222 &
    - sleep 10
    - ssh -o StrictHostKeyChecking=no -i ~/.ssh/id -p 2222 root@localhost poweroff