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 0563827
Showing 1 changed file with 77 additions and 86 deletions.
163 changes: 77 additions & 86 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,114 +96,53 @@ 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:
tmt:
name: /plans/features/(core|basic)
tmt_plan: '/plans/features/(core|basic)'

# 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).*$'
tmt_plan: '^(?!/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$'
tmt_plan: '/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
tmt_plan: '/plans/provision/virtual'
tf_extra_params:
test:
tmt:
name: /plans/provision/virtual
environments:
- 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
tmt_plan: '/tmt/integration/plan'

# Fedora releases
- job: propose_downstream
Expand Down

0 comments on commit 0563827

Please sign in to comment.