Merge branch 'ci-update' into 'master'

Update the Docker images used for CI

See merge request GNOME/glib!808
This commit is contained in:
Philip Withnall 2019-05-01 10:12:02 +00:00
commit 48b037fc3a
8 changed files with 361 additions and 21 deletions

View File

@ -1,5 +1,3 @@
image: registry.gitlab.gnome.org/gnome/glib/master:v11
stages:
- build
- coverage
@ -15,6 +13,7 @@ variables:
MESON_COMMON_OPTIONS: "--buildtype debug --fatal-meson-warnings"
fedora-x86_64:
image: registry.gitlab.gnome.org/gnome/glib/fedora:v1
stage: build
except:
- tags
@ -54,7 +53,37 @@ fedora-x86_64:
- "_build/${CI_JOB_NAME}-report.xml"
- "_coverage"
debian-stable-x86_64:
image: registry.gitlab.gnome.org/gnome/glib/debian-stable:v1
stage: build
except:
- tags
script:
- meson ${MESON_COMMON_OPTIONS}
--werror
--default-library=both
--prefix=$HOME/glib-installed
--libdir=lib
-Dsystemtap=true
-Ddtrace=true
-Dfam=true
-Dinstalled_tests=true
_build
- ninja -C _build
- .gitlab-ci/run-tests.sh
artifacts:
reports:
junit: "_build/${CI_JOB_NAME}-report.xml"
name: "glib-${CI_JOB_NAME}-${CI_COMMIT_REF_NAME}"
when: always
paths:
- "_build/config.h"
- "_build/glib/glibconfig.h"
- "_build/meson-logs"
- "_build/${CI_JOB_NAME}-report.xml"
G_DISABLE_ASSERT:
image: registry.gitlab.gnome.org/gnome/glib/fedora:v1
stage: build
except:
- tags
@ -93,6 +122,7 @@ G_DISABLE_ASSERT:
cross-android_api21_arm64:
<<: *cross-template
image: registry.gitlab.gnome.org/gnome/glib/android-ndk:v1
script:
# FIXME: add --werror
# We use -Diconv=auto to test that we successfully detect that iconv is not
@ -102,6 +132,7 @@ cross-android_api21_arm64:
cross-android_api28_arm64:
<<: *cross-template
image: registry.gitlab.gnome.org/gnome/glib/android-ndk:v1
script:
# FIXME: add --werror
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_android_arm64_28.txt -Dinternal_pcre=true _build
@ -109,6 +140,7 @@ cross-android_api28_arm64:
cross-mingw64:
<<: *cross-template
image: registry.gitlab.gnome.org/gnome/glib/mingw:v1
script:
# FIXME: Add --werror
- meson ${MESON_COMMON_OPTIONS} --cross-file=/opt/cross_file_mingw64.txt _build
@ -195,6 +227,7 @@ freebsd-11-x86_64:
- "_build/${CI_JOB_NAME}-report.xml"
coverage:
image: registry.gitlab.gnome.org/gnome/glib/fedora:v1
stage: coverage
except:
- tags
@ -217,6 +250,7 @@ pages:
- public
dist-job:
image: registry.gitlab.gnome.org/gnome/glib/fedora:v1
stage: build
only:
- tags

View File

@ -1,9 +1,11 @@
FROM fedora:27
FROM fedora:28
RUN dnf -y install \
autoconf \
automake \
bindfs \
clang \
clang-analyzer \
desktop-file-utils \
elfutils-libelf-devel \
findutils \
@ -39,11 +41,6 @@ RUN dnf -y install \
libtool \
libxslt \
make \
mingw64-gcc \
mingw64-gcc-c++ \
mingw64-gettext \
mingw64-libffi \
mingw64-zlib \
ncurses-compat-libs \
ninja-build \
pcre-devel \
@ -66,8 +63,6 @@ RUN ./android-setup-env.sh arm64 21
RUN ./android-setup-env.sh arm64 28
RUN rm -rf $ANDROID_NDK_PATH
COPY cross_file_mingw64.txt /opt
RUN pip3 install meson==0.48.0
ARG HOST_USER_ID=5555

View File

@ -0,0 +1,73 @@
FROM debian:stretch
RUN apt-get update -qq && apt-get install --no-install-recommends -qq -y \
bindfs \
clang \
clang-tools-4.0 \
dbus \
desktop-file-utils \
elfutils \
findutils \
fuse \
gcc \
g++ \
gettext \
git \
libc6-dev \
gtk-doc-tools \
itstool \
lcov \
libattr1-dev \
libelf-dev \
libffi-dev \
libgamin-dev \
libmount-dev \
libpcre2-dev \
libselinux1-dev \
libxml2-utils \
libxslt1-dev \
libz3-dev \
locales \
ninja-build \
python3 \
python3-pip \
python3-setuptools \
python3-wheel \
shared-mime-info \
systemtap-sdt-dev \
unzip \
wget \
xsltproc \
xz-utils \
zlib1g-dev \
&& rm -rf /usr/share/doc/* /usr/share/man/*
# Locale for our build
RUN locale-gen C.UTF-8 && /usr/sbin/update-locale LANG=C.UTF-8
# Locales for our tests
RUN locale-gen de_DE.UTF-8 \
&& locale-gen el_GR.UTF-8 \
&& locale-gen en_US.UTF-8 \
&& locale-gen es_ES.UTF-8 \
&& locale-gen fa_IR.UTF-8 \
&& locale-gen fr_FR.UTF-8 \
&& locale-gen hr_HR.UTF-8 \
&& locale-gen ja_JP.UTF-8 \
&& locale-gen lt_LT.UTF-8 \
&& locale-gen pl_PL.UTF-8 \
&& locale-gen ru_RU.UTF-8 \
&& locale-gen tr_TR.UTF-8
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8
RUN pip3 install meson==0.48.0
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG=C.UTF-8 LANGUAGE=C.UTF-8 LC_ALL=C.UTF-8

View File

@ -0,0 +1,64 @@
FROM fedora:29
RUN dnf -y install \
bindfs \
clang \
clang-analyzer \
dbus-daemon \
desktop-file-utils \
elfutils-libelf-devel \
findutils \
fuse \
gamin-devel \
gcc \
gcc-c++ \
gettext \
git \
glibc-devel \
glibc-headers \
glibc-langpack-de \
glibc-langpack-el \
glibc-langpack-el \
glibc-langpack-en \
glibc-langpack-es \
glibc-langpack-es \
glibc-langpack-fa \
glibc-langpack-fr \
glibc-langpack-hr \
glibc-langpack-ja \
glibc-langpack-lt \
glibc-langpack-pl \
glibc-langpack-ru \
glibc-langpack-tr \
gtk-doc \
itstool \
lcov \
libattr-devel \
libffi-devel \
libmount-devel \
libselinux-devel \
libxslt \
ncurses-compat-libs \
ninja-build \
pcre-devel \
python3 \
python3-pip \
python3-wheel \
shared-mime-info \
systemtap-sdt-devel \
unzip \
wget \
xz \
zlib-devel \
&& dnf clean all
RUN pip3 install meson==0.48.0
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG C.UTF-8

View File

@ -0,0 +1,70 @@
FROM fedora:29
RUN dnf -y install \
bindfs \
clang \
clang-analyzer \
desktop-file-utils \
elfutils-libelf-devel \
findutils \
fuse \
gamin-devel \
gcc \
gcc-c++ \
gettext \
git \
glibc-devel \
glibc-headers \
glibc-langpack-de \
glibc-langpack-el \
glibc-langpack-el \
glibc-langpack-en \
glibc-langpack-es \
glibc-langpack-es \
glibc-langpack-fa \
glibc-langpack-fr \
glibc-langpack-hr \
glibc-langpack-ja \
glibc-langpack-lt \
glibc-langpack-pl \
glibc-langpack-ru \
glibc-langpack-tr \
gtk-doc \
itstool \
lcov \
libattr-devel \
libffi-devel \
libmount-devel \
libselinux-devel \
libxslt \
mingw64-gcc \
mingw64-gcc-c++ \
mingw64-gettext \
mingw64-libffi \
mingw64-zlib \
ncurses-compat-libs \
ninja-build \
pcre-devel \
python3 \
python3-pip \
python3-wheel \
systemtap-sdt-devel \
unzip \
wget \
xz \
zlib-devel \
&& dnf clean all
WORKDIR /opt
COPY cross_file_mingw64.txt /opt
RUN pip3 install meson==0.48.0
ARG HOST_USER_ID=5555
ENV HOST_USER_ID ${HOST_USER_ID}
RUN useradd -u $HOST_USER_ID -ms /bin/bash user
USER user
WORKDIR /home/user
ENV LANG C.UTF-8

View File

@ -1,18 +1,120 @@
#!/bin/bash
read_arg() {
# $1 = arg name
# $2 = arg value
# $3 = arg parameter
local rematch='^[^=]*=(.*)$'
if [[ $2 =~ $rematch ]]; then
read "$1" <<< "${BASH_REMATCH[1]}"
else
read "$1" <<< "$3"
# There is no way to shift our callers args, so
# return 1 to indicate they should do it instead.
return 1
fi
}
set -e
TAG="registry.gitlab.gnome.org/gnome/glib/master:v11"
build=0
run=0
push=0
list=0
print_help=0
no_login=0
while (($# > 0)); do
case "${1%%=*}" in
build) build=1;;
run) run=1;;
push) push=1;;
list) list=1;;
help) print_help=1;;
--base|-b) read_arg base "$@" || shift;;
--base-version) read_arg base_version "$@" || shift;;
--no-login) no_login=1;;
*) echo -e "\e[1;31mERROR\e[0m: Unknown option '$1'"; exit 1;;
esac
shift
done
if [ $print_help == 1 ]; then
echo "$0 - Build and run Docker images"
echo ""
echo "Usage: $0 <command> [options] [basename]"
echo ""
echo "Available commands"
echo ""
echo " build --base=<BASENAME> - Build Docker image <BASENAME>.Dockerfile"
echo " run --base=<BASENAME> - Run Docker image <BASENAME>"
echo " push --base=<BASENAME> - Push Docker image <BASENAME> to the registry"
echo " list - List available images"
echo " help - This help message"
echo ""
exit 0
fi
cd "$(dirname "$0")"
docker build --build-arg HOST_USER_ID="$UID" --tag "${TAG}" \
--file "Dockerfile" .
if [ "$1" = "--push" ]; then
docker login registry.gitlab.gnome.org
docker push $TAG
else
docker run --rm \
--volume "$(pwd)/..:/home/user/app" --workdir "/home/user/app" \
--tty --interactive "${TAG}" bash
if [ $list == 1 ]; then
echo "Available Docker images:"
for f in *.Dockerfile; do
filename=$( basename -- "$f" )
basename="${filename%.*}"
echo -e " \e[1;39m$basename\e[0m"
done
exit 0
fi
# All commands after this require --base to be set
if [ -z $base ]; then
echo "Usage: $0 <command>"
exit 1
fi
if [ ! -f "$base.Dockerfile" ]; then
echo -e "\e[1;31mERROR\e[0m: Dockerfile for '$base' not found"
exit 1
fi
if [ -z $base_version ]; then
base_version="latest"
else
base_version="v$base_version"
fi
TAG="registry.gitlab.gnome.org/gnome/glib/${base}:${base_version}"
if [ $build == 1 ]; then
echo -e "\e[1;32mBUILDING\e[0m: ${base} as ${TAG}"
sudo docker build \
--build-arg HOST_USER_ID="$UID" \
--tag "${TAG}" \
--file "${base}.Dockerfile" .
exit $?
fi
if [ $push == 1 ]; then
echo -e "\e[1;32mPUSHING\e[0m: ${base} as ${TAG}"
if [ $no_login == 0 ]; then
sudo docker login registry.gitlab.gnome.org
fi
sudo docker push $TAG
exit $?
fi
if [ $run == 1 ]; then
echo -e "\e[1;32mRUNNING\e[0m: ${base} as ${TAG}"
sudo docker run \
--rm \
--volume "$(pwd)/..:/home/user/app" \
--workdir "/home/user/app" \
--tty \
--interactive "${TAG}" \
bash
exit $?
fi

View File

@ -56,7 +56,9 @@
*
* ...and still compile successfully when -Werror=duplicated-branches is passed. */
#if defined(__GNUC__) && __GNUC__ > 6
#pragma GCC diagnostic ignored "-Wduplicated-branches"
#endif
/**
* SECTION:hash_tables

View File

@ -21,7 +21,7 @@
/* We test for errors in optimize-only definitions in gmem.h */
#ifdef __GNUC__
#if defined(__GNUC__) && __GNUC__ > 6
#pragma GCC optimize (1)
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Walloc-size-larger-than="