Commit 76641b85 authored by Otto Kekäläinen's avatar Otto Kekäläinen Committed by Samuel Thibault
Browse files

Add Gitlab-CI definition file that can test each commit to this repository

Modeled after what Debian Salsa CI team uses, see
https://salsa.debian.org/salsa-ci-team/pipeline/raw/master/salsa-ci.yml

Modified a bit to stay under the 4 MB log size limit
and 100 MB artefact limit.

Attempted to get all of Salsa CI working, but ran into failures and was
unable to overcome all of them, so leaving some parts of the pipeline
disabled for now.
parent 0ae9bd69
Pipeline #24060 failed with stages
in 94 minutes and 24 seconds
variables:
DEBFULLNAME: "Salsa Pipeline"
DEBEMAIL: "<salsa-pipeline@debian.org>"
DEBIAN_FRONTEND: noninteractive
WORKING_DIR: ./debian/output
DEB_BUILD_OPTIONS: "nocheck noautodbgsym"
stages:
- build
- test
image: debian:unstable
build package:
stage: build
artifacts:
expire_in: 180 day
name: "$CI_BUILD_NAME"
paths:
- ${WORKING_DIR}/
script:
- apt-get update
- apt-get install eatmydata -y
- eatmydata apt-get build-dep -y .
- eatmydata apt-get install git-buildpackage -y
- gbp pull --ignore-branch
- while true; do sleep 600; echo "10 minutes passed" >&2; done & # Progress keeper since build is long and silent
- gbp buildpackage --git-ignore-branch --git-export-dir=${WORKING_DIR} -us -uc | tail -n 10000 # Keep log under 4 MB
- du -shc ${WORKING_DIR}/* # Show total file size of artifacts. Must stay are under 100 MB.
# Autopkgtest must be disabled, because the test 'upstream' will be skipped and
# thus the command returns exit code 2 and is considered failed by Gitlab CI.
# Removing 'breaks-testbed' stanza from tests/control will result in that the
# test is run on Gitlab CI, but then it will fail in multiple tests as it cannot
# bind to network interfaces and other needes stuff inside Gitlab CI containers.
#
#run autopkgtest:
# stage: test
# script:
# - apt-get update && apt-get install autopkgtest eatmydata -y --no-install-recommends
# - eatmydata autopkgtest ${WORKING_DIR}/*.deb -- null
run lintian:
stage: test
script:
- apt-get update && apt-get install lintian -y --no-install-recommends
- lintian -iI ${WORKING_DIR}/*.changes
# Reprotest exceeds the 2 hour timeout limit on Github CI, so results in failure
# and must be disabled until a quicker (times two) build is possible.
#run reprotest:
# stage: test
# image: genericpipeline/reprotest-docker
# artifacts:
# name: "$CI_BUILD_NAME"
# expire_in: 180 day
# paths:
# - ./reprotest.log
# when: always
# script:
# - apt-get update && apt-get install eatmydata -y
# - eatmydata apt-get build-dep -y .
# - export DEB_BUILD_OPTIONS=nocheck
# - eatmydata reprotest . -- null &> reprotest.log
# tags:
# - privileged
# Piuparts is passing on official piuparts.debian.org, but fail on Gitlab CI
# with 'FAIL: Package purging left files on system'. Disabling for now.
#run piuparts:
# stage: test
# image: genericpipeline/piuparts-docker
# services:
# - docker:dind
# script:
# - CHROOT_PATH=/tmp/debian-unstable
# - CONTAINER_ID=$(docker run --rm -d debian:unstable sleep infinity)
# - docker exec ${CONTAINER_ID} bash -c "apt-get update && apt-get install eatmydata -y"
# - mkdir -p ${CHROOT_PATH}
# - docker export ${CONTAINER_ID} | tar -C ${CHROOT_PATH} -xf -
# - mknod -m 666 ${CHROOT_PATH}/dev/urandom c 1 9
# - piuparts --hard-link -e ${CHROOT_PATH} ${WORKING_DIR}/*.deb
# tags:
# - privileged
......@@ -21,6 +21,22 @@ set -ex
# 2) Creates a test table and checks it appears to operate normally
# using the test user and test database.
# Start the deamon if it was not running. For example in Docker testing
# environments there might not be any systemd et al and the service needs to
# be started manually.
if ! which systemctl
then
if ! /etc/init.d/mysql status
then
echo "Did not find systemctl and deamon was not running, starting it.."
/etc/init.d/mysql start
fi
else
# If systemd (and systemctl) is available, but the service did not start, then
# this smoke test is supposed to fail if next commands don't work.
echo "Found systemctl, continuing smoke test.."
fi
mysql <<EOT
CREATE DATABASE testdatabase;
CREATE USER 'testuser'@'localhost' identified by 'testpassword';
......
Supports Markdown
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