Permalink
Fetching contributors…
Cannot retrieve contributors at this time
39 lines (38 sloc) 2.07 KB
language: shell
dist: xenial
env:
global:
- URL=http://cdimage.ubuntu.com/ubuntu-base/xenial/daily/current/xenial-base-amd64.tar.gz
- CHROOT=xenial-test-chroot
- CHROOT_RUN="sudo chroot $CHROOT"
- LC_ALL=C.UTF-8
- LANG=C.UTF-8
- SHCKOPTS="-e SC2013,SC2129"
# SC2013: we actually want words in the cases where this complaint happens
# SC2129: we want to see when the logging stopped so grouping is no option
install:
- mkdir -p $CHROOT/build
- wget -q -O - $URL | zcat - | sudo tar x -C $CHROOT
- sudo cp /etc/resolv.conf $CHROOT/etc/
- sudo mount --rbind /dev $CHROOT/dev
- sudo mount --rbind /proc $CHROOT/proc
- sudo mount --rbind /sys $CHROOT/sys
- $CHROOT_RUN apt update
- $CHROOT_RUN apt install -y shellcheck file build-essential devscripts
- sudo modprobe kvm
- $CHROOT_RUN apt install -y qemu-system-x86 qemu-utils python3 snapd squashfs-tools cpio
- sudo cp -a initramfs config $CHROOT/build/
# install all build deps defined in the control file
- $CHROOT_RUN apt install -y $(grep -h Build-Depends {initramfs,config}/debian/control|sed 's/^.*://g;s/,//g;s/([^)]*)//g'| tr -d '\n'| sort | uniq)
- $CHROOT_RUN sh -c 'LC_ALL=C.UTF-8 make -C build/initramfs/testing'
script:
# run unit tests in a virtual machine
- $CHROOT_RUN sh -c 'cd build/initramfs/testing; LC_ALL=C.UTF-8 ./aaa-tests.py --verbose'
# run shellcheck on all the shell scripts
- $CHROOT_RUN sh -c 'cd build; for file in $(find . | xargs file | grep shell |grep -v .git| sed "s/:.*$/ /g" | tr -d "\n"); do shellcheck $SHCKOPTS $file; done'
# test build src packages unsigned in a xenial chroot
- $CHROOT_RUN sh -c 'cd build/initramfs; LC_ALL=C.UTF-8 dpkg-buildpackage -rfakeroot -S -sa -us -uc'
- $CHROOT_RUN sh -c 'cd build/config; LC_ALL=C.UTF-8 dpkg-buildpackage -rfakeroot -S -sa -us -uc'
# and also test build binary packages unsigned in a xenial chroot
- $CHROOT_RUN sh -c 'cd build/initramfs; LC_ALL=C.UTF-8 dpkg-buildpackage -rfakeroot -b -us -uc'
- $CHROOT_RUN sh -c 'cd build/config; LC_ALL=C.UTF-8 dpkg-buildpackage -rfakeroot -b -us -uc'