Commit 8ab44133 authored by Chris Lamb's avatar Chris Lamb 💬

Merge our two CI pipeline stages, avoiding an additional ~5 minute initial...

Merge our two CI pipeline stages, avoiding an additional ~5 minute initial setup/teardown time as well as avoiding having to parse the checksums of the yet-to-be-downloaded build dependencies.
parent 8c619de8
Pipeline #70418 passed with stage
in 58 minutes and 10 seconds
stages:
- test-packages
- test
cache:
......@@ -9,57 +8,23 @@ cache:
variables:
GIT_DEPTH: "3"
##
.test-packages-template: &test-packages
stage: test-packages
before_script:
- apt-get -q update
script:
- time t/bin/build-test-packages-if-needed .cache
artifacts:
paths:
- test-packages.tar.xz
.test-template: &test
stage: test
before_script:
- apt-get -q update
- env DEBIAN_FRONTEND=noninteractive apt-get -q -y -o dir::cache::archives=".cache" build-dep .
- time t/bin/build-test-packages-if-needed .cache
script:
- tar xfJ test-packages.tar.xz
- time t/bin/runtests
##
unstable-test-packages:
<<: *test-packages
image: debian:unstable
testing-test-packages:
<<: *test-packages
image: debian:testing
stable-bpo-test-packages:
<<: *test-packages
image: debian:stable-backports
##
unstable:
<<: *test
image: debian:unstable
dependencies:
- unstable-test-packages
testing:
<<: *test
image: debian:testing
dependencies:
- testing-test-packages
stable-bpo:
<<: *test
image: debian:stable-backports
dependencies:
- stable-bpo-test-packages
......@@ -30,12 +30,9 @@ Checksum_input () {
debian/ \
-type f -print0 | sort -z | xargs -0 sha1sum
# Rebuild if any build-dependency or installed package changes
(
apt -q -y --print-uris build-dep . 2>/dev/null | \
grep MD5Sum: | cut -d' ' -f2 | cut -d_ -f1-2;
dpkg -l | awk '{ print $2 "_" $3 }'
) | sort
# Rebuild if any installed package changes; assumes we have already
# installed all build-dependencies.
dpkg -l | grep '^ii' | sort
}
CHECKSUM="$(Checksum_input | sha1sum | cut -d ' ' -f1)"
......@@ -45,12 +42,11 @@ rm -rf debian/test-out
echo "I: Looking for ${CACHE_FILENAME}" >&2
if [ ! -f "${CACHE_FILENAME}" ]
if [ -f "${CACHE_FILENAME}" ]
then
env DEBIAN_FRONTEND=noninteractive apt-get -q -y -o dir::cache::archives="${CACHE_DIR}" build-dep .
tar xfJ ${CACHE_FILENAME}
else
t/bin/build-test-packages
mkdir -p "$(dirname "${CACHE_FILENAME}")"
mkdir -p ${CACHE_DIR}
tar cfJ "${CACHE_FILENAME}" debian/test-out
fi
cp -v "${CACHE_FILENAME}" test-packages.tar.xz
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment