Skip to content

Commit

Permalink
Simplify packit configuration
Browse files Browse the repository at this point in the history
  • Loading branch information
LecrisUT committed Nov 21, 2024
1 parent 44cb172 commit 7444b81
Showing 1 changed file with 72 additions and 70 deletions.
142 changes: 72 additions & 70 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand 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
Expand All @@ -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:
Expand All @@ -59,36 +107,28 @@ 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:
tmt:
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:
tmt:
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:
Expand All @@ -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
Expand Down

0 comments on commit 7444b81

Please sign in to comment.