Build packages on Fedora CI
This commit is contained in:
parent
fdf511644e
commit
dd5ff52621
36
tests/mocktest.sh
Executable file
36
tests/mocktest.sh
Executable file
@ -0,0 +1,36 @@
|
||||
#!/usr/bin/bash -eux
|
||||
|
||||
config="/tmp/fedora-rawhide-x86_64-ci.cfg"
|
||||
|
||||
# create mock config if not present
|
||||
# this makes sure tested version of pyproject-rpm-macros is available
|
||||
# TODO: check if it has precedence if the release was not bumped in tested PR
|
||||
if [ ! -f $config ]; then
|
||||
original="/etc/mock/fedora-rawhide-x86_64.cfg"
|
||||
split=$(sed -n '/\[fedora\]/=' $original | head -n1)
|
||||
head -n$(($split-1)) $original > $config
|
||||
cat /etc/yum.repos.d/test-pyproject-rpm-macros.repo >> $config
|
||||
echo >> $config
|
||||
tail -n +$split $original >> $config
|
||||
fi
|
||||
|
||||
# prepare the rpmbuild folders, make sure nothing relevant is there
|
||||
mkdir -p ~/rpmbuild/{SOURCES,SRPMS}
|
||||
rm -f ~/rpmbuild/SRPMS/${1}-*.src.rpm
|
||||
|
||||
# download the sources and create SRPM
|
||||
spectool -g -R ${1}.spec
|
||||
rpmbuild -bs ${1}.spec
|
||||
|
||||
# build the SRPM in mock
|
||||
mock -r $config --enablerepo=local init
|
||||
mock -r $config --enablerepo=local ~/rpmbuild/SRPMS/${1}-*.src.rpm
|
||||
|
||||
# move the results to the artifacts directory, so we can examine them
|
||||
artifacts=${TEST_ARTIFACTS:-/tmp/artifacts}
|
||||
pushd /var/lib/mock/fedora-rawhide-x86_64/result
|
||||
mv *.rpm ${artifacts}/
|
||||
for log in *.log; do
|
||||
mv ${log} ${artifacts}/${1}-${log}
|
||||
done
|
||||
popd
|
25
tests/tests.yml
Normal file
25
tests/tests.yml
Normal file
@ -0,0 +1,25 @@
|
||||
---
|
||||
- hosts: localhost
|
||||
tags:
|
||||
- classic
|
||||
tasks:
|
||||
- dnf:
|
||||
name: "*"
|
||||
state: latest
|
||||
|
||||
- hosts: localhost
|
||||
roles:
|
||||
- role: standard-test-basic
|
||||
tags:
|
||||
- classic
|
||||
tests:
|
||||
- pytest:
|
||||
dir: .
|
||||
run: ./mocktest.sh python-pytest
|
||||
- entrypoints:
|
||||
dir: .
|
||||
run: ./mocktest.sh python-entrypoints
|
||||
required_packages:
|
||||
- mock
|
||||
- rpmdevtools
|
||||
- rpm-build
|
Loading…
Reference in New Issue
Block a user