Skip to content

Commit eff6ded

Browse files
authored
ci: add rpmlint and smoke tests (#313)
Similar to the PR in `scikit-build`: Fixed a few downstream suggestions, added some simple smoke tests and rpmlinting --------- Signed-off-by: Cristian Le <[email protected]>
1 parent 0472fd7 commit eff6ded

File tree

11 files changed

+99
-12
lines changed

11 files changed

+99
-12
lines changed

.distro/.fmf/version

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

.distro/packit.toml

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
Filters = [
2+
"unknown-key",
3+
]

.distro/plans/main.fmf.dist-git

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
discover:
2+
how: fmf
3+
dist-git-source: true
4+
path: .distro

.distro/plans/rpmlint.fmf

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
summary:
2+
Perform rpmlint and rpminspect tests
3+
prepare:
4+
- name: Install rpmlint packages
5+
how: install
6+
package:
7+
- rpmlint
8+
- rpminspect
9+
- rpminspect-data-fedora
10+
- name: Download the source rpm
11+
how: shell
12+
script: cd /tmp && curl -O ${PACKIT_SRPM_URL}
13+
- name: Download rpm packages
14+
how: shell
15+
script: cd /tmp && dnf download ${PACKIT_COPR_RPMS}
16+
discover+:
17+
how: fmf
18+
filter: "tag: rpmlint"
19+
execute:
20+
how: tmt

.distro/plans/smoke.fmf

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
summary:
2+
Basic smoke tests
3+
discover+:
4+
how: fmf
5+
filter: "tag: smoke"
6+
execute:
7+
how: tmt
Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +0,0 @@
1-
addFilter("files-duplicate .*/__init__.py")
Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,11 @@
1-
%global pypi_name scikit_build_core
2-
31
Name: python-scikit-build-core
42
Version: 0.0.0
5-
Release: %{autorelease}
3+
Release: %autorelease
64
Summary: Build backend for CMake based projects
75

86
License: Apache-2.0
97
URL: https://github.com/scikit-build/scikit-build-core
10-
Source0: %{pypi_source %{pypi_name}}
11-
Source1: %{name}.rpmlintrc
8+
Source: %{pypi_source scikit_build_core}
129

1310
BuildArch: noarch
1411
BuildRequires: python3-devel
@@ -18,7 +15,8 @@ BuildRequires: gcc
1815
BuildRequires: gcc-c++
1916

2017
%global _description %{expand:
21-
A next generation Python CMake adaptor and Python API for plugins}
18+
A next generation Python CMake adaptor and Python API for plugins
19+
}
2220

2321
%description %_description
2422

@@ -32,19 +30,22 @@ Suggests: ninja-build
3230
Suggests: gcc
3331
%description -n python3-scikit-build-core %_description
3432

33+
3534
%prep
36-
%autosetup -n %{pypi_name}-%{version}
35+
%autosetup -n scikit_build_core-%{version}
36+
3737

3838
%generate_buildrequires
3939
%pyproject_buildrequires -x test
4040

41+
4142
%build
4243
%pyproject_wheel
4344

4445

4546
%install
4647
%pyproject_install
47-
%pyproject_save_files %{pypi_name}
48+
%pyproject_save_files scikit_build_core
4849

4950

5051
%check
@@ -56,5 +57,6 @@ Suggests: gcc
5657
%license LICENSE
5758
%doc README.md
5859

60+
5961
%changelog
6062
%autochangelog

.distro/tests/rpmlint.fmf

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Common test variables
2+
tag:
3+
- rpmlint
4+
tier: 0
5+
path: /
6+
7+
# Define tests
8+
/rpmlint-spec:
9+
summary: Rpmlint the spec files
10+
test: rpmlint ./python-scikit-build-core.spec
11+
/rpmlint-rpms:
12+
summary: Rpmlint the rpms
13+
test: rpmlint -c packit.toml /tmp/*.rpm
14+
/rpminspect-rpms:
15+
summary: Rpminspect the rpms
16+
test: ls /tmp/*.rpm | xargs -L1 rpminspect-fedora -E metadata,disttag

.distro/tests/smoke.fmf

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
# Common test variables
2+
tag:
3+
- smoke
4+
tier: 0
5+
path: /
6+
7+
# Define tests
8+
/version:
9+
test: python3 -c "import scikit_build_core; print(scikit_build_core.__version__)"

.gitignore

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -153,7 +153,7 @@ tests/**/build/
153153
*.swp
154154

155155
# RPM spec file
156-
!/.distro/scikit-build-core.spec
156+
!/.distro/*.spec
157157
/.distro/*.tar.gz
158158
*.rpm
159159

@@ -170,3 +170,7 @@ ehthumbs.db
170170
Thumbs.db
171171

172172
.idea/
173+
# tmt setup
174+
/.distro/main.fmf
175+
/.distro/plans/main.fmf
176+
/.distro/tests/main.fmf

0 commit comments

Comments
 (0)