]> git.ipfire.org Git - thirdparty/systemd.git/blob - semaphoreci/gcc-compilation.sh
8755b850b60b0a25350d492e67ffbaf7ad892724
[thirdparty/systemd.git] / semaphoreci / gcc-compilation.sh
1 #!/bin/bash
2
3 set -ex
4
5 # keep this in sync with setup.sh
6 CONTAINER=${RELEASE:-buster}-${ARCH:-amd64}
7 AUTOPKGTESTDIR=${SEMAPHORE_CACHE_DIR:-/tmp}/autopkgtest
8 # semaphore cannot expose these, but useful for interactive/local runs
9 ARTIFACTS_DIR=/tmp/artifacts
10
11 # add current debian/ packaging
12 git fetch --depth=1 https://salsa.debian.org/systemd-team/systemd.git master
13 git checkout FETCH_HEAD debian
14
15 # craft changelog
16 UPSTREAM_VER=$(git describe | sed 's/^v//')
17 cat << EOF > debian/changelog.new
18 systemd (${UPSTREAM_VER}-0) UNRELEASED; urgency=low
19
20 * Automatic build for upstream test
21
22 -- systemd test <pkg-systemd-maintainers@lists.alioth.debian.org> $(date -R)
23
24 EOF
25 cat debian/changelog >> debian/changelog.new
26 mv debian/changelog.new debian/changelog
27
28 # clean out patches
29 rm -rf debian/patches
30 # disable autopkgtests which are not for upstream
31 sed -i '/# NOUPSTREAM/ q' debian/tests/control
32 # enable more unit tests
33 sed -i '/^CONFFLAGS =/ s/=/= -Dtests=unsafe -Dsplit-usr=true -Dslow-tests=true /' debian/rules
34 # no orig tarball
35 echo '1.0' > debian/source/format
36
37 # build source package
38 dpkg-buildpackage -S -I -I$(basename "$SEMAPHORE_CACHE_DIR") -d -us -uc -nc
39
40 # now build the package and run the tests
41 rm -rf "$ARTIFACTS_DIR"
42 # autopkgtest exits with 2 for "some tests skipped", accept that
43 $AUTOPKGTESTDIR/runner/autopkgtest --apt-upgrade --env DEB_BUILD_OPTIONS=noudeb --env TEST_UPSTREAM=1 ../systemd_*.dsc -o "$ARTIFACTS_DIR" -- lxc -s $CONTAINER || [ $? -eq 2 ]