Blob Blame History Raw
specfile_path: tmt.spec
files_to_sync:
  - tmt.spec
  - .packit.yaml
sync_changelog: true

upstream_package_name: tmt
downstream_package_name: tmt

upstream_project_url: https://github.com/teemtee/tmt
issue_repository: https://github.com/teemtee/tmt

srpm_build_deps:
  - hatch
  - python3-hatch-vcs

jobs:

  # Build pull requests
  - job: copr_build
    trigger: pull_request
    targets:
      - fedora-all
      - epel-9
    enable_net: False
    actions:
        create-archive:
          - hatch run docs:man
          - hatch build -t sdist
          - bash -c "ls dist/tmt-*.tar.gz"
        get-current-version:
          # Use `dev888` instead of the last version digit to make
          # builds older than the final release and newer than
          # copr builds from main. Remove the remaining suffix
          # generated by `hatch version` as well so that build
          # with the latest timestamp always wins.
          - bash -c "hatch version | sed -E 's/\\.[0-9]+\\.dev.*/.dev888/'"

  # Test pull requests (core)
  - job: tests
    identifier: core
    trigger: pull_request
    targets:
      - fedora-latest-stable
      - epel-9
    tf_extra_params:
        test:
            tmt:
                name: /plans/features/(core|basic)

  # Test pull requests (full)
  # Do not run extended unit tests, that plan gets its own job because
  # of podman vs systemd-resolved flakiness.
  - job: tests
    identifier: full
    trigger: pull_request
    targets:
      - fedora-all
      - epel-9
    require:
        label:
          present:
            - full test
          absent:
            - discuss
    tf_extra_params:
        test:
            tmt:
                name: '^(?!/plans/features/extended-unit-tests).*$'

  - job: tests
    identifier: extended-unit-tests
    trigger: pull_request
    targets:
      - fedora-latest-stable
    require:
        label:
          present:
            - full test
          absent:
            - discuss
    tf_extra_params:
        test:
            tmt:
                name: '/plans/features/extended-unit-tests$'

  # Test pull requests (provision)
  - job: tests
    identifier: provision
    trigger: pull_request
    use_internal_tf: True
    targets:
      - fedora-latest-stable
    tf_extra_params:
        test:
            tmt:
                name: /plans/provision/virtual
        environments:
          - tmt:
                context:
                    how: provision
    require:
        label:
          present:
            - full test
          absent:
            - discuss

  # Test internal plugins
  - job: tests
    trigger: pull_request
    identifier: "internal-plugins"
    targets:
      - fedora-latest-stable
    use_internal_tf: True
    fmf_url: "https://gitlab.cee.redhat.com/baseos-qe/tmt.git"
    # Tag cloud resources for tmt
    tf_extra_params:
        environments:
          - settings:
                provisioning:
                    tags:
                        BusinessUnit: tmt
    require:
        label:
          present:
            - full test
          absent:
            - discuss

  # Test internal wow
  - job: tests
    trigger: pull_request
    identifier: "internal-wow"
    targets:
      - fedora-latest-stable
    use_internal_tf: True
    fmf_url: "https://gitlab.cee.redhat.com/baseos-qe/integration_scripts.git"
    tmt_plan: "/tmt/integration/plan"
    tf_extra_params:
        environments:
          - settings:
                provisioning:
                    tags:
                        BusinessUnit: tmt
    require:
        label:
          present:
            - full test
          absent:
            - discuss

  # Build commits to main
  - job: copr_build
    trigger: commit
    branch: main
    targets:
      - fedora-all
      - epel-9
    enable_net: False
    list_on_homepage: True
    preserve_project: True
    owner: "@teemtee"
    project: tmt
    release_suffix: "{PACKIT_PROJECT_BRANCH}"
    actions:
        create-archive:
          - hatch run docs:man
          - hatch build -t sdist
          - bash -c "ls dist/tmt-*.tar.gz"
        get-current-version:
          # Get rid of the the final version digit to make copr
          # builds older than the final release
          - bash -c "hatch version | sed -E 's/\\.[0-9]+\\.dev/.dev/'"

  # Release to copr
  - job: copr_build
    trigger: release
    targets:
      - fedora-all
      - epel-9
    enable_net: False
    list_on_homepage: True
    preserve_project: True
    owner: "@teemtee"
    project: tmt
    actions:
        create-archive:
          - hatch run docs:man
          - hatch build -t sdist
          - bash -c "ls dist/tmt-*.tar.gz"
        get-current-version:
          - hatch version

  # Fedora releases
  - job: propose_downstream
    trigger: release
    dist_git_branches:
      - fedora-all
      - epel-9

  - job: koji_build
    trigger: commit
    allowed_pr_authors: ["packit", "psss", "lzachar"]
    allowed_committers: ["packit", "psss", "lzachar"]
    dist_git_branches:
      - fedora-all
      - epel-9

  - job: bodhi_update
    trigger: commit
    dist_git_branches:
      - fedora-branched
      - epel-9