Skip to content

Commit

Permalink
Initialize packit workflow
Browse files Browse the repository at this point in the history
Signed-off-by: Cristian Le <[email protected]>
  • Loading branch information
LecrisUT authored and pboettch committed Nov 27, 2023
1 parent 704a545 commit 1f0eb98
Show file tree
Hide file tree
Showing 11 changed files with 195 additions and 0 deletions.
1 change: 1 addition & 0 deletions .distro/.fmf/version
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
1
4 changes: 4 additions & 0 deletions .distro/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/main.fmf
/plans/main.fmf
/tests/main.fmf
*.tar.gz
Empty file.
61 changes: 61 additions & 0 deletions .distro/json-schema-validator.spec
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
Name: json-schema-validator
Summary: JSON schema validator for JSON for Modern C++
Version: 0.0.0
Release: %autorelease
License: MIT
URL: https://github.com/pboettch/json-schema-validator

Source: https://github.com/pboettch/json-schema-validator/archive/refs/tags/v%{version}.tar.gz

BuildRequires: ninja-build
BuildRequires: cmake
BuildRequires: gcc-c++
BuildRequires: json-devel

%description
Json schema validator library for C++ projects using nlohmann/json

%package devel
Summary: Development files for JSON schema validator
Requires: json-schema-validator%{?_isa} = %{version}-%{release}
Requires: json-devel

%description devel
Json schema validator development files for C++ projects using nlohmann/json


%prep
%autosetup -n json-schema-validator-%{version}


%build
%cmake \
-DJSON_VALIDATOR_SHARED_LIBS=ON \
-DJSON_VALIDATOR_INSTALL=ON \
-DJSON_VALIDATOR_BUILD_EXAMPLES=OFF \
-DJSON_VALIDATOR_BUILD_TESTS=ON

%cmake_build


%install
%cmake_install


%check
%ctest


%files
%doc README.md
%license LICENSE
%{_libdir}/libnlohmann_json_validator.so.*

%files devel
%{_libdir}/libnlohmann_json_validator.so
%{_includedir}/nlohmann/json-schema.hpp
%{_libdir}/cmake/nlohmann_json_schema_validator


%changelog
%autochangelog
3 changes: 3 additions & 0 deletions .distro/packit.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
Filters = [
"unknown-key",
]
4 changes: 4 additions & 0 deletions .distro/plans/main.fmf.dist-git
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
discover:
how: fmf
dist-git-source: true
path: .distro
14 changes: 14 additions & 0 deletions .distro/plans/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
summary:
Perform rpmlint and rpminspect tests
prepare:
- name: Download the source rpm
how: shell
script: cd /tmp && curl -O ${PACKIT_SRPM_URL}
- name: Download rpm packages
how: shell
script: cd /tmp && dnf download ${PACKIT_COPR_RPMS}
discover+:
how: fmf
filter: "tag: rpmlint"
execute:
how: tmt
7 changes: 7 additions & 0 deletions .distro/plans/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary:
Basic smoke tests
discover+:
how: fmf
filter: "tag: smoke"
execute:
how: tmt
13 changes: 13 additions & 0 deletions .distro/tests/rpmlint.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
# Common test variables
tag:
- rpmlint
tier: 0
path: /

# Define tests
/rpmlint:
summary: Rpmlint spec and rpmfiles
test: rpmlint -c packit.toml -r json-schema-validator.rpmlintrc ./*.spec /tmp/*.rpm
/rpminspect-rpms:
summary: Rpminspect the rpms
test: ls /tmp/*.rpm | xargs -L1 rpminspect-fedora -E metadata,disttag
9 changes: 9 additions & 0 deletions .distro/tests/smoke.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Common test variables
tag:
- smoke
tier: 0
path: /

# Define tests
/version:
test: echo "TODO: Write a minimum working example"
79 changes: 79 additions & 0 deletions .packit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,79 @@
specfile_path: .distro/json-schema-validator.spec
files_to_sync:
- src: .distro/json-schema-validator.spec
dest: json-schema-validator.spec
- .packit.yaml
- src: .distro/json-schema-validator.rpmlintrc
dest: json-schema-validator.rpmlintrc
# tmt setup
- src: .distro/.fmf/
dest: .fmf/
- src: .distro/plans/
dest: plans/
filters:
- "- .distro/plans/main.fmf.dist-git"
- "- .distro/plans/rpmlint.fmf"
- src: .distro/plans/main.fmf.dist-git
dest: plans/main.fmf
upstream_package_name: json-schema-validator
downstream_package_name: json-schema-validator
update_release: false
upstream_tag_template: v{version}

jobs:
- job: copr_build
trigger: pull_request
owner: lecris
project: json-schema-validator
update_release: true
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
targets:
- fedora-development
- job: tests
trigger: pull_request
targets:
- fedora-development
fmf_path: .distro
- job: copr_build
trigger: commit
branch: main
owner: lecris
project: nightly
# TODO: Remove when upstream issue is resolved
# https://github.com/packit/packit/issues/1924
additional_repos:
- copr://@scikit-build/release
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- job: copr_build
trigger: release
owner: lecris
project: release
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- job: tests
trigger: commit
branch: main
targets:
- fedora-development
- fedora-latest
fmf_path: .distro
- job: propose_downstream
trigger: release
dist_git_branches:
- fedora-development
- fedora-latest
- job: koji_build
trigger: commit
dist_git_branches:
- fedora-all
- job: bodhi_update
trigger: commit
dist_git_branches:
- fedora-branched

0 comments on commit 1f0eb98

Please sign in to comment.