Skip to content

Commit

Permalink
ci: Fix Fedora CI (#464)
Browse files Browse the repository at this point in the history
- Use fedora packages with `--no-index` and `--no-build-isolation`
- Enabled missing tests
- Placeholder for nanobind tests (Not yet packaged on fedora)

---------

Signed-off-by: Cristian Le <cristian.le@mpsd.mpg.de>
  • Loading branch information
LecrisUT authored Aug 14, 2023
1 parent c139af0 commit 0cd69e1
Show file tree
Hide file tree
Showing 9 changed files with 62 additions and 8 deletions.
23 changes: 19 additions & 4 deletions .packit.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -32,15 +32,22 @@ jobs:
update_release: true
release_suffix: "{PACKIT_RPMSPEC_RELEASE}"
targets:
- fedora-development
- fedora-latest
# TODO: Switch to fedora-all once F37 support is dropped
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-latest-stable-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
- job: tests
trigger: pull_request
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-latest-stable-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
- job: copr_build
trigger: commit
branch: main
Expand All @@ -49,23 +56,31 @@ jobs:
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-latest-stable-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
- job: tests
trigger: commit
branch: main
targets:
- fedora-development
- fedora-latest
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-latest-stable-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
- job: copr_build
trigger: release
owner: "@scikit-build"
project: release
targets:
- fedora-development-x86_64
- fedora-latest-x86_64
- fedora-latest-stable-x86_64
- fedora-development-aarch64
- fedora-latest-aarch64
- fedora-latest-stable-aarch64
- job: propose_downstream
trigger: release
dist_git_branches:
Expand Down
4 changes: 4 additions & 0 deletions docs/examples/downstream/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
environment:
HAS_PYTEST: true
require+:
- python3-pytest
7 changes: 7 additions & 0 deletions docs/examples/downstream/nanobind_example/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary:
Nanobind downstream example
adjust:
enabled: false
because: Nanobind is not yet packaged on Fedora
#require+:
# - python3-nanobind
5 changes: 5 additions & 0 deletions docs/examples/downstream/pybind11_example/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
summary:
Pybind downstream example
require+:
- gcc-c++
- pybind11-devel
2 changes: 2 additions & 0 deletions docs/examples/getting_started/cython/main.fmf
Original file line number Diff line number Diff line change
@@ -1,2 +1,4 @@
summary:
Cython example project
require+:
- python3-cython
2 changes: 2 additions & 0 deletions docs/examples/getting_started/fortran/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,5 @@ summary:
F2PY example project
require+:
- gcc-gfortran
- python3-numpy
- python3-numpy-f2py
7 changes: 7 additions & 0 deletions docs/examples/getting_started/nanobind/main.fmf
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
summary:
Nanobind example project
adjust:
enabled: false
because: Nanobind is not yet packaged on Fedora
#require+:
# - python3-nanobind
1 change: 1 addition & 0 deletions docs/examples/getting_started/pybind11/main.fmf
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,4 @@ summary:
Pybind example project
require+:
- gcc-c++
- pybind11-devel
19 changes: 15 additions & 4 deletions docs/examples/test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,27 @@ source /usr/share/beakerlib/beakerlib.sh || exit 1
rlJournalStart
rlPhaseStartSetup
rlRun "tmp=\$(mktemp -d)" 0 "Create tmp directory"
rlRun "rsync -r ${TMT_SOURCE_DIR:-$TMT_TREE}$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
rlRun "rsync -r ${TMT_SOURCE_DIR:-$TMT_TREE}$TMT_TEST_NAME/../test.py $tmp" 0 "Copy test.py file"
if [ -z ${TMT_SOURCE_DIR} ]; then
tmt_root=${TMT_TREE}
else
tmt_root=${TMT_SOURCE_DIR}/scikit_build_core-*
fi
rlRun "rsync -r ${tmt_root}$TMT_TEST_NAME/ $tmp" 0 "Copy example project"
if [ "${HAS_PYTEST}" != True ]; then
rlRun "rsync -r ${tmt_root}/docs/examples/getting_started/test.py $tmp" 0 "Copy test.py file"
fi
rlRun "pushd $tmp"
rlRun "tree" 0 "Show directory tree"
rlRun "set -o pipefail"
rlPhaseEnd

rlPhaseStartTest
rlRun "pip install . --config-settings=cmake.verbose=true" 0 "Build the python project"
rlRun "python3 test.py" 0 "Test project is installed correctly"
rlRun "pip install --user . --config-settings=cmake.verbose=true --no-index --no-build-isolation" 0 "Build the python project"
if [ "${HAS_PYTEST}" == True ]; then
rlRun "pytest" 0 "Run built-in pytest"
else
rlRun "python3 test.py" 0 "Test project is installed correctly"
fi
rlPhaseEnd

rlPhaseStartCleanup
Expand Down

0 comments on commit 0cd69e1

Please sign in to comment.