ci: Delete dockerfile, move to common scripts, consolidate gcc/clang
The Dockerfile is problematic since we can't update it atomically. I also really dislike reliance on the Hub. Further, I think rather than caching our build deps as built containers, we should be caching RPMs in CI. And we should be using rpm-ostree at some point to assemble filesystem trees faster. Also, consolidate the clang to be serial with gcc, since while we lose a tiny bit of parallelism, it's not really worth its own context right now. Closes: #759 Approved by: jlebon
This commit is contained in:
parent
23a9e7e1bc
commit
4bbea19a31
@ -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
|
@ -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
|
||||
|
18
ci/build-check.sh
Executable file
18
ci/build-check.sh
Executable file
@ -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
|
23
ci/build.sh
Executable file
23
ci/build.sh
Executable file
@ -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
|
28
ci/libbuild.sh
Normal file
28
ci/libbuild.sh
Normal file
@ -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
|
||||
}
|
Loading…
Reference in New Issue
Block a user