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.

Closes: coreos#759
Approved by: jlebon
  • Loading branch information
cgwalters authored and rh-atomic-bot committed Apr 28, 2017
1 parent 23a9e7e commit 4bbea19
Show file tree
Hide file tree
Showing 5 changed files with 75 additions and 90 deletions.
31 changes: 0 additions & 31 deletions .redhat-ci.Dockerfile

This file was deleted.

65 changes: 6 additions & 59 deletions .redhat-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:

---

Expand All @@ -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:
Expand All @@ -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 changes: 18 additions & 0 deletions ci/build-check.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 23 additions & 0 deletions ci/build.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 28 additions & 0 deletions ci/libbuild.sh
Original file line number Diff line number Diff line change
@@ -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
}

0 comments on commit 4bbea19

Please sign in to comment.