---
include:
  - https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/recipes/debian.yml

check-enhances:
 stage: test
 image: "$SALSA_CI_IMAGES_BASE"
 needs:
  job: build
  artifacts: true
 before_script:
 - echo "Starting check of 'Enhances:' field in debian/control"
 - apt-get update && eatmydata apt-get install --yes --no-install-recommends dpkg-dev
 - PACKAGE_NAME="$(dpkg-parsechangelog -S Source)"
 - PACKAGE_VERSION="$(dpkg-parsechangelog -S Version)+salsaci"
 - PACKAGE_ARCH="$(dpkg --print-architecture)"
 - env
 - PACKAGE="$(find . -name '*.deb')"
 - echo "Looking for $PACKAGE"
 - ls -lh "$PACKAGE"
 - eatmydata apt install --yes --no-install-recommends "$PACKAGE"
 script:
 - eatmydata ./debian/tests/find-debs-that-are-enhanced

variables:
  SALSA_CI_ENABLE_WRAP_AND_SORT: 'true'
  SALSA_CI_WRAP_AND_SORT_ARGS: '--short-indent --sort-binary-packages --keep-first --trailing-comma -v'
  SALSA_CI_AUTOPKGTEST_ALLOWED_EXIT_STATUS: '0'
  SALSA_CI_LINTIAN_FAIL_WARNING: '1'
