From 7444b8169310f3c5e787f8bbbef3ef8e5bc92f3b Mon Sep 17 00:00:00 2001 From: Cristian Le Date: Thu, 21 Nov 2024 14:27:59 +0100 Subject: [PATCH] Simplify packit configuration --- .packit.yaml | 142 ++++++++++++++++++++++++++------------------------- 1 file changed, 72 insertions(+), 70 deletions(-) diff --git a/.packit.yaml b/.packit.yaml index 5908b020a5..080b98dd83 100644 --- a/.packit.yaml +++ b/.packit.yaml @@ -18,8 +18,6 @@ actions: &base-actions - hatch run docs:man - hatch build -t sdist - bash -c "ls dist/tmt-*.tar.gz" - get-current-version: - - hatch version targets: &all-targets - fedora-all @@ -28,10 +26,64 @@ targets: &all-targets # Uncomment below line if OpenScanHub scans are failing # osh_diff_scan_after_copr_build: false +_: + - &copr_on_packit + job: copr_build + - &copr_on_tmt + <<: *copr_on_packit + list_on_homepage: True + preserve_project: True + owner: "@teemtee" + project: tmt + - &test_base + job: tests + trigger: pull_request + - &latest-targets + - fedora-latest-stable + - epel-9 + - &internal + use_internal_tf: True + targets: + - fedora-latest-stable + tf_extra_params: + environments: + - &tmt-cloud-resources + settings: + provisioning: + tags: + BusinessUnit: tmt + - &require-full-tests + require: + label: + present: + - ci | full test + absent: + - status | discuss + + jobs: + # Release to copr + - <<: *copr_on_tmt + trigger: release + actions: + <<: *base-actions + get-current-version: + - hatch version + + # Build commits to main + - <<: *copr_on_tmt + trigger: commit + branch: main + release_suffix: "{PACKIT_PROJECT_BRANCH}" + actions: + <<: *base-actions + 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/'" + # Build pull requests - - &copr_build - job: copr_build + - <<: *copr_on_packit trigger: pull_request actions: <<: *base-actions @@ -44,12 +96,8 @@ jobs: - bash -c "hatch version | sed -E 's/\\.[0-9]+\\.dev.*/.dev888/'" # Test core - - &tests - job: tests - trigger: pull_request - targets: &latest-targets - - fedora-latest-stable - - epel-9 + - <<: *test_base + targets: *latest-targets identifier: core tf_extra_params: test: @@ -59,14 +107,8 @@ jobs: # Test full # Do not run extended unit tests, that plan gets its own job because # of podman vs systemd-resolved flakiness. - - <<: *tests - targets: *all-targets - require: &require-full-tests - label: - present: - - ci | full test - absent: - - status | discuss + - <<: *test_base + <<: *require-full-tests identifier: full tf_extra_params: test: @@ -74,9 +116,9 @@ jobs: name: '^(?!/plans/features/extended-unit-tests).*$' # Extended unit tests - - <<: *tests + - <<: *test_base + <<: *require-full-tests targets: [ fedora-latest-stable ] - require: *require-full-tests identifier: extended-unit-tests tf_extra_params: test: @@ -84,11 +126,9 @@ jobs: name: '/plans/features/extended-unit-tests$' # Test virtual provision - - <<: *tests - use_internal_tf: True - targets: &internal-targets - - fedora-latest-stable - require: *require-full-tests + - <<: *test_base + <<: *internal + <<: *require-full-tests identifier: provision tf_extra_params: test: @@ -98,60 +138,22 @@ jobs: - tmt: context: how: provision - - &tmt-cloud-resources - settings: - provisioning: - tags: - BusinessUnit: tmt + - *tmt-cloud-resources # Test internal plugins - - <<: *tests - use_internal_tf: True - targets: *internal-targets - require: *require-full-tests + - <<: *test_base + <<: *internal + <<: *require-full-tests identifier: internal-plugins fmf_url: "https://gitlab.cee.redhat.com/baseos-qe/tmt.git" - # Tag cloud resources for tmt - tf_extra_params: - environments: - - *tmt-cloud-resources # Test internal wow - - <<: *tests - use_internal_tf: True - targets: *internal-targets - require: *require-full-tests + - <<: *test_base + <<: *internal + <<: *require-full-tests identifier: internal-wow fmf_url: "https://gitlab.cee.redhat.com/baseos-qe/integration_scripts.git" tmt_plan: "/tmt/integration/plan" - tf_extra_params: - environments: - - *tmt-cloud-resources - - # Build commits to main - - <<: *copr_build - trigger: commit - branch: main - list_on_homepage: True - preserve_project: True - owner: "@teemtee" - project: tmt - release_suffix: "{PACKIT_PROJECT_BRANCH}" - actions: - <<: *base-actions - 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 - - <<: *copr_build - trigger: release - list_on_homepage: True - preserve_project: True - owner: "@teemtee" - project: tmt - actions: *base-actions # Fedora releases - job: propose_downstream