diff --git a/.redhat-ci.Dockerfile b/.redhat-ci.Dockerfile deleted file mode 100644 index 296cf5e600..0000000000 --- a/.redhat-ci.Dockerfile +++ /dev/null @@ -1,31 +0,0 @@ -FROM fedora:25 - -# We could use the upstream spec file here, but anyway for -# runtime reqs, we're at the mercy of whatever in the -# updates repo. Though we do explicitly use updates-testing -# so our CI coverage indirectly tests that. - -RUN dnf config-manager --set-enabled updates-testing && \ - dnf install -y @buildsys-build && \ - dnf install -y 'dnf-command(builddep)' && \ - dnf builddep -y rpm-ostree && \ - dnf install -y rpm-ostree && \ - rpm -e rpm-ostree - -# These are test-only reqs -RUN dnf install -y \ - ostree \ - createrepo_c \ - /usr/bin/jq \ - PyYAML \ - clang \ - libubsan \ - libasan \ - libtsan \ - elfutils \ - fuse \ - sudo \ - gnome-desktop-testing - -# create an unprivileged user for testing -RUN adduser testuser diff --git a/.redhat-ci.yml b/.redhat-ci.yml index a3aa291a14..e36f82b905 100644 --- a/.redhat-ci.yml +++ b/.redhat-ci.yml @@ -3,65 +3,20 @@ branches: - auto - try -context: check +context: f25-build-check required: true container: - image: projectatomic/rpm-ostree-tester - -# ⚠ Pull latest ostree for https://github.com/ostreedev/ostree/issues/758 -# And we now depend on 2017.4 -# Also, there's a copy of this below in the compose context -# And also in tests/vmcheck/overlay.sh -packages: - - https://kojipkgs.fedoraproject.org//packages/ostree/2017.5/2.fc25/x86_64/ostree-2017.5-2.fc25.x86_64.rpm - - https://kojipkgs.fedoraproject.org//packages/ostree/2017.5/2.fc25/x86_64/ostree-devel-2017.5-2.fc25.x86_64.rpm - - https://kojipkgs.fedoraproject.org//packages/ostree/2017.5/2.fc25/x86_64/ostree-libs-2017.5-2.fc25.x86_64.rpm - -env: - CFLAGS: '-fsanitize=undefined' - -build: - config-opts: > - --prefix=/usr - --libdir=/usr/lib64 - --enable-installed-tests - --enable-gtk-doc + image: registry.fedoraproject.org/fedora:25 tests: - - make check - - gnome-desktop-testing-runner rpm-ostree - - sudo --user=testuser gnome-desktop-testing-runner rpm-ostree + - ci/build-check.sh timeout: 30m artifacts: - test-suite.log - - config.log - ---- - -inherit: true - -context: Clang - -required: true - -env: - CC: 'clang' - CFLAGS: '-Werror=unused-variable' - -build: - config-opts: > - --prefix=/usr - --libdir=/usr/lib64 - --enable-installed-tests - --enable-gtk-doc - --enable-new-name - -tests: -artifacts: --- @@ -80,9 +35,10 @@ cluster: - name: vmcheck3 distro: fedora/25/atomic container: - image: projectatomic/rpm-ostree-tester + image: registry.fedoraproject.org/fedora:25 tests: + - ./ci/build.sh - make vmcheck HOSTS="vmcheck1 vmcheck2 vmcheck3" artifacts: @@ -107,16 +63,7 @@ host: tests: - > docker run --privileged -v $(pwd):/srv/code --rm - projectatomic/rpm-ostree-tester /bin/sh -c " - yum -y install https://kojipkgs.fedoraproject.org//packages/ostree/2017.5/2.fc25/x86_64/ostree-{,libs-,devel-,grub2-}2017.5-2.fc25.x86_64.rpm && - cd /srv/code && - env NOCONFIGURE=1 ./autogen.sh && - ./configure --prefix=/usr --libdir=/usr/lib64 && - make && - make install && - dnf update -y bubblewrap && - ./tests/compose - " + registry.fedoraproject.org/fedora:25 /bin/sh -c "cd /srv/code && ./ci/build.sh && make install && ./tests/compose" artifacts: - compose.log diff --git a/ci/build-check.sh b/ci/build-check.sh new file mode 100755 index 0000000000..d0add41785 --- /dev/null +++ b/ci/build-check.sh @@ -0,0 +1,18 @@ +#!/usr/bin/bash +# Install build dependencies, run unit tests and installed tests. + +set -xeuo pipefail + +dn=$(dirname $0) +. ${dn}/libbuild.sh +${dn}/build.sh +make check +make install +gnome-desktop-testing-runner rpm-ostree +sudo --user=testuser gnome-desktop-testing-runner rpm-ostree +git clean -dfx + +# And now a clang build to find unused variables +export CC=clang +export CFLAGS='-Werror=unused-variable' +build_default diff --git a/ci/build.sh b/ci/build.sh new file mode 100755 index 0000000000..46841bdfc7 --- /dev/null +++ b/ci/build.sh @@ -0,0 +1,23 @@ +#!/usr/bin/bash +# Install build dependencies, run unit tests and installed tests. + +set -xeuo pipefail + +dn=$(dirname $0) +. ${dn}/libbuild.sh + +install_builddeps rpm-ostree + +# ⚠ Pull latest ostree for https://github.com/ostreedev/ostree/issues/758 +# And we now depend on 2017.4 +# Also, there's a copy of this below in the compose context +# And also in tests/vmcheck/overlay.sh +yum -y install https://kojipkgs.fedoraproject.org//packages/ostree/2017.5/2.fc25/x86_64/ostree-{,libs-,devel-,grub2-}2017.5-2.fc25.x86_64.rpm + +dnf install -y createrepo_c /usr/bin/jq PyYAML clang \ + libubsan libasan libtsan elfutils fuse sudo gnome-desktop-testing + +# create an unprivileged user for testing +adduser testuser + +build --enable-installed-tests --enable-gtk-doc diff --git a/ci/libbuild.sh b/ci/libbuild.sh new file mode 100644 index 0000000000..f85b2d388e --- /dev/null +++ b/ci/libbuild.sh @@ -0,0 +1,28 @@ +#!/usr/bin/bash + +make() { + /usr/bin/make -j $(getconf _NPROCESSORS_ONLN) +} + +build() { + env NOCONFIGURE=1 ./autogen.sh + ./configure --prefix=/usr --libdir=/usr/lib64 "$@" + make +} + +build_default() { + export CFLAGS='-fsanitize=undefined' + build +} + +install_builddeps() { + pkg=$1 + dnf -y install dnf-plugins-core + dnf install -y @buildsys-build + dnf install -y 'dnf-command(builddep)' + + # builddeps+runtime deps + dnf builddep -y $pkg + dnf install -y $pkg + rpm -e $pkg +}