Add a GitLab CI file for git.git

This is a work-in-progress. The way this'll work is:

 1. This is maintained in https://gitlab.com/git-vcs/git-gitlab-ci
 2. We'll run a script (to be added) that'll pull down
    https://gitlab.com/git-vcs/git (or any git.git). Then merge this
    git-gitlab-ci.git with it, and push it out to
    https://gitlab.com/git-vcs/git-ci
 3. Eventually we might be able to upstream this .gitlab-ci.yml
parents
.test_job_template: &test_job_template
stage: test
only:
refs:
- master
- next
- pu
.gcc_farm_template: &gcc_farm_template
<<: *test_job_template
tags:
- gcc-farm
script:
- ci/gitlab/run-on-gcc-farm.sh
# See https://cfarm.tetaneutral.net/machines/list/
gcc10 Debian 9.5 Linux 4.9.0 AMD Engineering Sample:
<<: *gcc_farm_template
gcc12 Debian 5.0.7 Linux 2.6.26-2-amd64:
<<: *gcc_farm_template
gcc110 CentOS 7 Linux 3.10 IBM POWER7:
<<: *gcc_farm_template
gcc111 AIX 7.1 IBM POWER7:
<<: *gcc_farm_template
gcc112 CentOS 7 Linux 3.10 IBM POWER8:
<<: *gcc_farm_template
gcc119 AIX 7.2 IBM POWER8:
<<: *gcc_farm_template
gcc135 CentOS 7 Linux 4.14 IBM POWER9:
<<: *gcc_farm_template
gcc202 Debian sid UltraSparc T5:
<<: *gcc_farm_template
gcc210 Solaris 10 SPARC64-VII:
<<: *gcc_farm_template
gcc211 Solaris 11 SPARC64-VII:
<<: *gcc_farm_template
gcc302 OpenBSD 6.2 amd64:
<<: *gcc_farm_template
gcc303 FreeBSD 11.1 amd64:
<<: *gcc_farm_template
#!/bin/bash
# Testing:
# OPT_DEBUG=1 CI_JOB_NAME='gcc119' ci/gitlab/run-on-gcc-farm.sh
set -eo pipefail
if test -z "$OPT_REMOTE"
then
if test -n "$CI_JOB_NAME"
then
CI_GIT_GCC_HOST=$(echo "$CI_JOB_NAME" | cut -d ' ' -f 1)
else
CI_GIT_GCC_HOST=gcc112
fi
HEAD_name=$(git rev-parse --abbrev-ref HEAD)
if test "$HEAD_name" = "master" -o "$HEAD_name" = "next" -o "$HEAD_name" = "pu"
then
CI_GIT_COMMIT_SHA=$(git rev-parse HEAD^)
else
CI_GIT_COMMIT_SHA=$(git rev-parse git-master)
fi
archive=git-$CI_GIT_COMMIT_SHA.tar
git archive \
--format=tar \
--output=$archive \
--prefix=git-$CI_GIT_COMMIT_SHA/ \
$CI_GIT_COMMIT_SHA
gzip -f $archive
archive_gz=$archive.gz
echo "Copying $archive.gz to $CI_GIT_GCC_HOST.fsffrance.org"
scp -o StrictHostKeyChecking=no $archive_gz avar@$CI_GIT_GCC_HOST.fsffrance.org:
ssh -o StrictHostKeyChecking=no avar@$CI_GIT_GCC_HOST.fsffrance.org \
"OPT_REMOTE=$CI_GIT_GCC_HOST OPT_DEBUG=$OPT_DEBUG CI_GIT_COMMIT_SHA=$CI_GIT_COMMIT_SHA nice -n 19 bash -" \
<$0
else
# Config
TAR=tar
MAKE=gmake
JOBS=1
case $OPT_REMOTE in
gcc10|gcc12)
JOBS=4
MAKE=make
;;
gcc110|gcc202)
JOBS=12
;;
gcc111|gcc112|gcc135)
JOBS=24
;;
gcc119)
JOBS=24
;;
gcc210|gcc211)
JOBS=2
PATH=/opt/csw/gnu:$PATH:/opt/csw/bin
TAR=gtar
;;
esac
# Cleanup setup
function cleanup() {
echo "Removing git-$CI_GIT_COMMIT_SHA*"
cd
rm -rf \
~/git-$CI_GIT_COMMIT_SHA \
~/git-$CI_GIT_COMMIT_SHA.tar \
~/git-$CI_GIT_COMMIT_SHA.tar.gz
}
if test -n "$OPT_DEBUG"
then
echo "Am debbugging. Will eave behind git-$CI_GIT_COMMIT_SHA*"
else
trap cleanup EXIT
fi
# Notice
echo "Testing '$CI_GIT_COMMIT_SHA' on '$OPT_REMOTE' with '-j$JOBS'"
# Setup. 'z' in tar isn't portable on e.g. AIX
if ! test -d git-$CI_GIT_COMMIT_SHA
then
# Skip this if OPT_DEBUG=1, in which case this has likely been
# unpacked already.
gzip -f -d git-$CI_GIT_COMMIT_SHA.tar.gz
$TAR xf git-$CI_GIT_COMMIT_SHA.tar
fi
cd git-$CI_GIT_COMMIT_SHA
# Configure
>config.mak
case $OPT_REMOTE in
gcc10|gcc12):
echo 'NO_CURL=UnfortunatelyNot' >>config.mak
;;
gcc111|gcc119)
echo 'CC=xlc' >>config.mak
echo 'NO_CURL=UnfortunatelyNot' >>config.mak
;;
gcc210|gcc211)
test $OPT_REMOTE = 'gcc210' && echo 'CC=/opt/developerstudio12.5/bin/suncc' >>config.mak
test $OPT_REMOTE = 'gcc211' && echo 'CC=/opt/developerstudio12.5/bin/suncc' >>config.mak
test $OPT_REMOTE = 'gcc210' && echo 'NO_OPENSSL=UnfortunatelyNot' >>config.mak
test $OPT_REMOTE = 'gcc210' && echo 'NO_CURL=UnfortunatelyNot' >>config.mak
echo 'NO_ICONV=HasLinkerErrors' >>config.mak
echo 'NO_GETTEXT=HaveNoMsgfmt' >>config.mak
# https://public-inbox.org/git/87a7ly1djb.fsf@evledraar.gmail.com/T/#u
perl -pi -e 's/return (files_reflog_path_other_worktrees)(.*)/$1$2 break;/' refs/files-backend.c
;;
esac
# Build
$MAKE -j$JOBS
# Test
cd t
case $OPT_REMOTE in
gcc210|gcc211)
prove --exec /bin/bash -j$JOBS t0[0-9]*.sh
;;
*)
if prove --help 2>&1 | grep -q jobs
then
prove -j$JOBS t0[0-9]*.sh
else
# gcc12
prove t0[0-9]*.sh
fi
;;
esac
fi
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