workflow:
  auto_cancel:
    on_new_commit: interruptible


include:
  - project: Infrastructure/freedesktop-ci-templates
    file: templates/fedora.yml

.fedora:
  extends: .fdo.distribution-image@fedora
  interruptible: true
  needs: ["docker-image"]
  variables:
    ###
    # IMPORTANT
    # These are the version tags for the docker images the CI runs against.
    # If you are hacking on them or need a them to rebuild, its enough
    # to change any part of the string of the image you want.
    ###
    FDO_DISTRIBUTION_TAG: '2025-10-03.0'
    FDO_DISTRIBUTION_VERSION: '42'
    FDO_DISTRIBUTION_PACKAGES: >
      meson ninja-build gcc g++ git gettext glib2-devel libjpeg-turbo-devel
      libpng-devel json-glib-devel lcms2-devel diffutils shellcheck devscripts
    FDO_UPSTREAM_REPO: $CI_PROJECT_PATH
    # Enable colorful output when supported (e.g. ninja)
    CLICOLOR_FORCE: "1"
    # Disable timestamps on CI logs
    FF_TIMESTAMPS: false


stages:
  - dependencies
  - build
  - analysis


docker-image:
  extends:
    - .fedora
    - .fdo.container-build@fedora
  needs: []
  stage: dependencies
  variables:
    GIT_STRATEGY: none

fedora-x86_64:
  extends: .fedora
  stage: build
  script:
    - git clone --depth 1 https://gitlab.gnome.org/GNOME/babl.git
    - cd babl && meson _build && ninja -C _build && ninja -C _build install && cd ..
    - meson --buildtype debug
            --fatal-meson-warnings
            --default-library=both
            _build
    - ninja -C _build
  artifacts:
    name: "gegl-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
    when: always
    paths:
      - "_build/meson-logs"
    expire_in: 8 days

meson-health:
  extends: .fedora
  stage: analysis
  script:
    - sh .gitlab/run_meson_health_diff.sh
  allow_failure: true

branches-check:
  extends: .fedora
  rules:
    - if: '$CI_PIPELINE_SOURCE == "push" && $CI_OPEN_MERGE_REQUESTS == null && $CI_COMMIT_REF_NAME == $CI_DEFAULT_BRANCH'
  stage: analysis
  variables:
    GIT_DEPTH: "0"
  script:
    - sh .gitlab/check_dead_branches.sh
  allow_failure: true
