# HELP : https://gitlab.com/help/ci/yaml/README.md
# Global defaults for all jobs
default:
  interruptible: true

stages:
  - test

variables:
  ARTIFACT_DOWNLOAD_ATTEMPTS: 3
  EXECUTOR_JOB_SECTION_ATTEMPTS: 3
  GET_SOURCES_ATTEMPTS: 3
  RESTORE_CACHE_ATTEMPTS: 3
  TRANSFER_METER_FREQUENCY: "2s"
  ARTIFACT_COMPRESSION_LEVEL: "fast"
  CACHE_COMPRESSION_LEVEL: "fastest"
  CACHE_REQUEST_TIMEOUT: 5
  XDEBUG_MODE: coverage

# // ---- Jobs ---- \\ #
# Find container registries images at
# https://gitlab.com/php-extended/docker-images/container_registry/
# And image files at
# https://gitlab.com/php-extended/docker-images

php-8.0:
  stage: test
  image: "$CI_REGISTRY/php-extended/docker-images:php-8.0-cli-dev"
  except:
    - tags
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure
  script:
    - ./runtests.sh --ci
  coverage: '/^\s*Lines: \s*\d+.\d+\%/'
  artifacts:
    when: always
    expire_in: 1 month
    reports:
      junit: ./build/report.xml


php-8.1:
  stage: test
  image: "$CI_REGISTRY/php-extended/docker-images:php-8.1-cli-dev"
  except:
    - tags
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure
  script:
    - ./runtests.sh --ci
  coverage: '/^\s*Lines: \s*\d+.\d+\%/'
  artifacts:
    when: always
    expire_in: 1 month
    reports:
      junit: ./build/report.xml


php-8.2:
  stage: test
  image: "$CI_REGISTRY/php-extended/docker-images:php-8.2-cli-dev"
  except:
    - tags
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure
  script:
    - ./runtests.sh --ci
  coverage: '/^\s*Lines: \s*\d+.\d+\%/'
  artifacts:
    when: always
    expire_in: 1 month
    reports:
      junit: ./build/report.xml


php-8.3:
  stage: test
  image: "$CI_REGISTRY/php-extended/docker-images:php-8.3-cli-dev"
  except:
    - tags
  retry:
    max: 2
    when:
      - runner_system_failure
      - stuck_or_timeout_failure
  script:
    - ./runtests.sh --ci
  coverage: '/^\s*Lines: \s*\d+.\d+\%/'
  artifacts:
    when: always
    expire_in: 1 month
    reports:
      junit: ./build/report.xml
