before_script:
    - sed -i 's/^\(Types. .*\)$/\1 deb-src/' /etc/apt/sources.list.d/debian.sources
    - apt-get --allow-unauthenticated update && apt-get build-dep --yes geoclue-2.0

workflow:
    rules:
        - if: $CI_PIPELINE_SOURCE == 'merge_request_event'
        - if: $CI_PIPELINE_SOURCE == 'push'

debian-bookworm:
    image: debian:bookworm
    artifacts:
        when: always
        name: "bookworm-${CI_COMMIT_REF_NAME}"
        paths:
            - "${CI_PROJECT_DIR}/build"
    script: meson setup build && ninja -C build && ninja -C build test && ninja -C build install

debian-bookworm-no-backend:
    image: debian:bookworm
    artifacts:
        when: always
        name: "bookworm-no-backend-${CI_COMMIT_REF_NAME}"
        paths:
            - "${CI_PROJECT_DIR}/build"
    script: meson setup -Denable-backend=false build && ninja -C build && ninja -C build test && ninja -C build install
