Skip to content

Commit

Permalink
ci: Delete dockerfile, move to common scripts, consolidate gcc/clang
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
cgwalters committed Apr 28, 2017
1 parent 23a9e7e commit 4498df0
Show file tree
Hide file tree
Showing 4 changed files with 56 additions and 88 deletions.
31 changes: 0 additions & 31 deletions .redhat-ci.Dockerfile

This file was deleted.

62 changes: 5 additions & 57 deletions .redhat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,36 +3,15 @@ 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.sh

timeout: 30m

Expand All @@ -44,29 +23,6 @@ artifacts:

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:

---

inherit: true

context: vmcheck

required: true
Expand All @@ -83,6 +39,7 @@ cluster:
image: projectatomic/rpm-ostree-tester

tests:
- ./ci/build.sh
- make vmcheck HOSTS="vmcheck1 vmcheck2 vmcheck3"

artifacts:
Expand All @@ -107,16 +64,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
24 changes: 24 additions & 0 deletions ci/build-deps.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/usr/bin/bash
# Install build dependencies in a container

set -xeuo pipefail

dnf -y install dnf-plugins-core
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

# ⚠ 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 ostree createrepo_c /usr/bin/jq PyYAML clang \
libubsan libasan libtsan elfutils fuse sudo gnome-desktop-testing

# create an unprivileged user for testing
adduser testuser
27 changes: 27 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
#!/usr/bin/bash
# Install build dependencies, run unit tests and installed tests.

set -xeuo pipefail

build() {
env NOCONFIGURE=1 ./autogen.sh
./configure --prefix=/usr --libdir=/usr/lib64 "$@"
make -j 8
}
build_default() {
build --enable-installed-tests --enable-gtk-doc
}

dn=$(dirname $0)
${dn}/build-deps.sh
export CFLAGS='-fsanitize=undefined'
build_default
make check
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

0 comments on commit 4498df0

Please sign in to comment.