Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Onboard Tmt #1405

Merged
merged 2 commits into from
Nov 10, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
21 changes: 21 additions & 0 deletions .github/workflows/pre-commit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
---
name: Pre Commit
on:
pull_request:
merge_group:
types: [checks_requested]


jobs:
pre-commit:
name: Pre Commit Hooks
runs-on: ubuntu-latest
container: ghcr.io/rpm-software-management/dnf-ci-host
steps:
- uses: actions/checkout@v3
- name: Install pre-commit
run: pip install pre-commit
- name: State to use Workspace Dir
run: git config --global --add safe.directory "$GITHUB_WORKSPACE"
- name: Run pre-commit on entire codebase
run: pre-commit run --show-diff-on-failure --color=always --all-files
10 changes: 10 additions & 0 deletions .packit.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# See the documentation for more information:
# https://packit.dev/docs/configuration/

jobs:
- job: tests
trigger: pull_request
targets:
- fedora-all
manual_trigger: true
skip_build: true
17 changes: 17 additions & 0 deletions .pre-commit-config.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# See https://pre-commit.com for more information
# See https://pre-commit.com/hooks.html for more hooks
repos:
- repo: https://github.com/pre-commit/pre-commit-hooks
rev: v3.2.0
hooks:
- id: check-added-large-files
- id: check-merge-conflict
# Passes if packit not installed. Needed for validation locally
- repo: https://github.com/packit/pre-commit-hooks
rev: v1.2.0
hooks:
- id: validate-config
- repo: https://github.com/teemtee/tmt.git
rev: 1.26.0
hooks:
- id: tmt-lint
6 changes: 6 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -32,6 +32,12 @@ RUN set -x && \
dnf -y upgrade; \
dnf -y distro-sync --repo copr:copr.fedorainfracloud.org:rpmsoftwaremanagement:dnf5-unstable;

RUN set -x && \
if [ -n "$COPR" ] && [ -n "$COPR_RPMS" ]; then \
dnf -y copr enable $COPR; \
dnf -y install $COPR_RPMS; \
fi

# copy test suite
COPY ./dnf-behave-tests/ /opt/ci/dnf-behave-tests

Expand Down
7 changes: 7 additions & 0 deletions plans/integration/behave-dnf5.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary: Run Behave Test Suite - DNF5
execute:
how: tmt
script: |
$TMT_PLANS_DATA/ci-dnf-stack/container-test run \
--tags dnf5 \
--command dnf5
7 changes: 7 additions & 0 deletions plans/integration/behave-dnf5daemon.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary: Run Behave Test Suite - DNF5DAEMON
execute:
how: tmt
script: |
$TMT_PLANS_DATA/ci-dnf-stack/container-test run \
--tags dnf5daemon \
--command dnf5daemon-client
28 changes: 28 additions & 0 deletions plans/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
summary: Prepare CI DNF Stack

prepare:
- name: Install packages to build fedora container
how: install
package: [git, podman]

- name: Download latest ci-dnf-stack from PR
how: shell
script:
- git clone https://github.com/rpm-software-management/ci-dnf-stack $TMT_PLANS_DATA/ci-dnf-stack

- name: Checkout PR branch if packit call is from ci-dnf-stack
how: shell
script: |
if [ "$PACKIT_UPSTREAM_NAME" -eq "ci-dnf-stack" ]; then \
git -C $TMT_PLANS_DATA/ci-dnf-stack remote add pull-request $PACKIT_SOURCE_URL \
git -C $TMT_PLANS_DATA/ci-dnf-stack fetch pull-request \
git -C $TMT_PLANS_DATA/ci-dnf-stack checkout --track \ pull-request/$PACKIT_SOURCE_BRANCH
fi

- name: Build testing container
how: shell
script: |
$TMT_PLANS_DATA/ci-dnf-stack/container-test build \
--base $( echo "$@distro" | tr '-' ':') \
--container-arg="--env=COPR=$PACKIT_COPR_PROJECT" \
--container-arg="--env=COPR_RPMS=$PACKIT_COPR_RPMS"
Loading