ci: run the rpm build tests in Fedora containers

Building rpm directly on Ubuntu is somewhat possible but it's fragile and
it cannot cover all quirks of rpm build. This commit switches the rpm build
tests to using fedora containers. This isn't also the best solution but
imho it's much better than the previous one.
This commit is contained in:
Ondřej Budai 2020-02-21 08:54:10 +01:00 committed by Tom Gundersen
parent ddb652ecc7
commit bd6e6bde56
2 changed files with 13 additions and 24 deletions

View file

@ -13,13 +13,18 @@ jobs:
script:
- python3 -m unittest test.test_osbuild
- python3 -m unittest test.test_objectstore
- name: rpm
before_install:
- sudo apt-get install -y rpm python3-setuptools
- sudo wget --directory-prefix=/usr/lib/rpm/macros.d https://src.fedoraproject.org/rpms/python-rpm-macros/raw/master/f/macros.python-srpm
- sudo wget --directory-prefix=/usr/lib/rpm/macros.d https://src.fedoraproject.org/rpms/python-rpm-macros/raw/master/f/macros.python
- sudo wget --directory-prefix=/usr/lib/rpm/macros.d https://src.fedoraproject.org/rpms/python-rpm-macros/raw/master/f/macros.python3
script: make rpm-nodeps
- name: rpm-f31
services:
- docker
script: docker run --rm -v $(pwd):/src fedora:31 sh -c "cd /src && dnf install -y 'dnf-command(builddep)' make git rpm-build && dnf builddep -y osbuild.spec && make rpm"
- name: rpm-f32
services:
- docker
script: docker run --rm -v $(pwd):/src fedora:32 sh -c "cd /src && dnf install -y 'dnf-command(builddep)' make git rpm-build && dnf builddep -y osbuild.spec && make rpm"
- name: rpm-f33
services:
- docker
script: docker run --rm -v $(pwd):/src fedora:33 sh -c "cd /src && dnf install -y 'dnf-command(builddep)' make git rpm-build && dnf builddep -y osbuild.spec && make rpm"
- name: pipeline-noop
before_install: sudo apt-get install -y systemd-container
script:

View file

@ -16,7 +16,7 @@ srpm: $(PACKAGE_NAME).spec check-working-directory tarball
--define "_srcrpmdir $(CURDIR)" \
$(PACKAGE_NAME).spec
rpm: $(PACKAGE_NAME).spec check-working-directory tarball
rpm: $(PACKAGE_NAME).spec check-working-directory tarball
- rm -r "`pwd`/output"
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
@ -31,22 +31,6 @@ rpm: $(PACKAGE_NAME).spec check-working-directory tarball
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/build"
rpm-nodeps: $(PACKAGE_NAME).spec tarball
- rm -r "`pwd`/output"
mkdir -p "`pwd`/output"
mkdir -p "`pwd`/rpmbuild"
/usr/bin/rpmbuild -bb \
--nodeps \
--define "_sourcedir `pwd`" \
--define "_specdir `pwd`" \
--define "_builddir `pwd`/rpmbuild" \
--define "_srcrpmdir `pwd`" \
--define "_rpmdir `pwd`/output" \
--define "_buildrootdir `pwd`/build" \
$(PACKAGE_NAME).spec
rm -r "`pwd`/rpmbuild"
rm -r "`pwd`/build"
copy-rpms-to-test: rpm
- rm test/testing-rpms/*.rpm
find `pwd`/output -name '*.rpm' -printf '%f\n' -exec cp {} test/testing-rpms/ \;