IT'S YOUR TURN TRAVIS MUHAHAH

This commit is contained in:
Kreyren 2020-02-09 16:45:47 +00:00
parent 15051a2cf9
commit e986a637e8
6 changed files with 66 additions and 82 deletions

@ -46,10 +46,11 @@ matrix:
group: travis_latest group: travis_latest
env: env:
DOCKER="ubuntu:eoan" DOCKER="ubuntu:eoan"
VARIANT="ubuntu" VARIANT="ubuntu-19.10"
TOOL="compile" TOOL="compile"
COMPILER_C="gcc" COMPILER_C="gcc"
COMPILER_CXX="g++" COMPILER_CXX="g++"
REPOSITORY="https://github.com/RXT0112/Zernit.git"
# Ubuntu 19.10 (Eoan Ermine) with Clang # Ubuntu 19.10 (Eoan Ermine) with Clang
- name: "Ubuntu 19.10 (Eoan Ermine) with Clang" - name: "Ubuntu 19.10 (Eoan Ermine) with Clang"
os: linux os: linux
@ -60,10 +61,11 @@ matrix:
group: travis_latest group: travis_latest
env: env:
DOCKER="ubuntu:eoan" DOCKER="ubuntu:eoan"
VARIANT="ubuntu" VARIANT="ubuntu-19.10"
TOOL="compile" TOOL="compile"
COMPILER_C="clang" COMPILER_C="clang"
COMPILER_CXX="clang++" COMPILER_CXX="clang++"
REPOSITORY="https://github.com/RXT0112/Zernit.git"
# Debian Linux # Debian Linux
# Debian Testing # Debian Testing

@ -9,7 +9,7 @@
. "QA/travis-ci/travis-common.sh" . "QA/travis-ci/travis-common.sh"
# shellcheck source=QA/travis-ci/get-container.sh # shellcheck source=QA/travis-ci/get-container.sh
. "$(dirname "$0")/get-container.sh" . "QA/travis-ci/get-container.sh"
fixme "Travis - before-install.sh disables SC1117 as hotfix" fixme "Travis - before-install.sh disables SC1117 as hotfix"

@ -5,7 +5,7 @@
# Copyright (C) 2018-2019 by Thomas Dreibholz <dreibh@iem.uni-due.de> as GPLv3 or any other GPL at your option # Copyright (C) 2018-2019 by Thomas Dreibholz <dreibh@iem.uni-due.de> as GPLv3 or any other GPL at your option
# shellcheck source=QA/travis-ci/travis-common.sh # shellcheck source=QA/travis-ci/travis-common.sh
. "$(dirname "$0")/travis-common.sh" . "QA/travis-ci/travis-common.sh"
if [ -n "$DOCKER" ]; then if [ -n "$DOCKER" ]; then
@ -18,7 +18,8 @@ if [ -n "$DOCKER" ]; then
fi fi
# Get name of package # Get name of package
PACKAGE="Kreyrock" fixme "Output package name based on repository name"
PACKAGE="Zernit"
# Set container name # Set container name
CONTAINER=$(printf '%s\n' "$PACKAGE-$DOCKER-$TOOL" | sed -e "s/:/_/g") CONTAINER=$(printf '%s\n' "$PACKAGE-$DOCKER-$TOOL" | sed -e "s/:/_/g")
@ -27,7 +28,9 @@ if [ -n "$DOCKER" ]; then
fi fi
export CONTAINER export CONTAINER
else elif [ -z "$DOCKER" ]; then
info "Docker is not used" info "Docker is not used"
unset CONTAINER
else
die 256 "Unexpected happend while processing DOCKER variable"
fi fi

@ -6,10 +6,10 @@
# Copyright (C) 2018-2019 by Thomas Dreibholz <dreibh@iem.uni-due.de> as GPLv3 or any other GPL at your option # Copyright (C) 2018-2019 by Thomas Dreibholz <dreibh@iem.uni-due.de> as GPLv3 or any other GPL at your option
# shellcheck source=QA/travis-ci/travis-common.sh # shellcheck source=QA/travis-ci/travis-common.sh
. "$(dirname "$0")/travis-common.sh" . "QA/travis-ci/travis-common.sh"
# shellcheck source=QA/travis-ci/get-container.sh # shellcheck source=QA/travis-ci/get-container.sh
. "$(dirname "$0")/get-container.sh" . "QA/travis-ci/get-container.sh"
fixme "Travis - install.sh is disabling SC1117 as hotfix" fixme "Travis - install.sh is disabling SC1117 as hotfix"
@ -19,86 +19,59 @@ RETRY_MAXTRIALS=5
RETRY_PAUSE=60 RETRY_PAUSE=60
# Linux as-is # Linux as-is
if [ "$TRAVIS_OS_NAME" = linux ] && [ -z "$DOCKER" ] && [ -z "$QEMU" ] && [ "$VARIANT" = ubuntu ]; then if [ "$TRAVIS_OS_NAME" = linux ] && [ -z "$DOCKER" ] && [ -z "$QEMU" ]; then
sudo apt update
if [ "$(apt-cache search libfuse3-dev | grep -o "libfuse3-dev")" = "libfuse3-dev" ]; then
# Fetch all dependencies
sudo apt-get install meson uthash-dev libcap-dev cppcheck libattr1-dev clang libfuse3-dev gcc git ninja-build bison libtool autoconf pkg-config libcap-dev indent fakeroot uthash-dev gzip rsync autopoint uthash-dev shellcheck -y
elif [ "$(apt-cache search libfuse3-dev | grep -o "libfuse3-dev")" = "libfuse3-dev" ]; then
sudo apt-get install meson uthash-dev libcap-dev cppcheck clang gcc git libattr1-dev ninja-build bison libtool autoconf pkg-config libcap-dev indent fakeroot uthash-dev gzip rsync autopoint shellcheck -y
# Travis is incompetent to provide usefull version of linux (https://travis-ci.community/t/more-virtual-environments/6213/7) so we have to fetch libfuse3-dev manually
warn "Travis-CI's ubuntu still doesn NOT offer 'libfuse3-dev', using hack to fetch it manually"
mkdir "$HOME/build/fuse3"
fixme "Export latest fuse3 instead of hard-coded in ci/before-install.sh"
wget https://github.com/libfuse/libfuse/releases/download/fuse-3.6.2/fuse-3.6.2.tar.xz -O "$HOME/build/fuse3/fuse-3.6.2.tar.xz"
tar xpf "$HOME/build/fuse3/fuse-3.6.2.tar.xz" --directory="$HOME/build/fuse3/"
mkdir "$HOME/build/fuse3/fuse-3.6.2/build"
fixme "Avoid using cd in ci/before-install.sh"
cd "$HOME/build/fuse3/fuse-3.6.2/build"|| die
meson .. --prefix /usr
ninja
sudo ninja install
# Update repositories based on available package manager
if command -v apt >/dev/null; then
sudo apt update || die 1 "Unable to update repositories on VARIANT '$VARIANT'"
elif command -v cave >/dev/null; then
cave sync || die 1 "Unable to update repositories on paludis"
else else
die "Unexpected in install.sh configuring linux as-is" die 256 "Unsupported package manager has been used"
fi fi
# Fetch shfmt (HACK!) # Install dependencies based on variant used
if [ "$(apt-cache search shfmt | grep -o "shfmt")" = "shfmt" ]; then case "$VARIANT" in
info "Installing shfmt" ubuntu-19.10)
apt install -y shfmt # Install dependencies
if [ -n "$PACKAGES" ]; then
sudo apt install -y "$PACKAGES" || die 1 "Unable to install following packages: '$PACKAGES'"
elif [ -z "$PACKAGES" ]; then
info "Dependencies are not specified in PACKAGES variable"
else
die 256 "Unexpected happend while processing PACKAGES variable"
fi
;;
*) die 2 "Unsupported variant '$VARIANT' has been parsed"
esac
elif [ "$(apt-cache search shfmt | grep -o "shfmt")" != "shfmt" ]; then # Do not clean repositories since docker images are not saved
warn "Package shfmt is not available, using hack to fetch it manually.."
# Get shfmt
if [ -e /usr/bin/shfmt ]; then
warn "File /usr/bin/shfmt already exists! This is unexpected assuming that shfmt is already provided on linux as-is?"
elif [ ! -e /usr/bin/shfmt ]; then
sudo wget https://github.com/mvdan/sh/releases/download/v3.0.0-beta1/shfmt_v3.0.0-beta1_linux_amd64 -O /usr/bin/shfmt
[ ! -x /usr/bin/shfmt ] && sudo chmod +x /usr/bin/shfmt
else
die "Unexpected happend in /usr/bin/shfmt"
fi
else
die "Unexpected happend in feteching shfmt in linux as-is"
fi
# Linux via Docker # Linux via Docker
elif [ "$TRAVIS_OS_NAME" = linux ] && [ -n "$DOCKER" ] && [ -z "$QEMU" ]; then elif [ "$TRAVIS_OS_NAME" = linux ] && [ -n "$DOCKER" ] && [ -z "$QEMU" ]; then
# Apt-based fixme "Fix duplicates of repository update"
if [ "$VARIANT" = ubuntu ] || [ "$VARIANT" = debian ]; then
# QA: Why are these variables? Looks like perfect scenario for a function..
APT_UPDATE='env LANG=C.UTF-8 apt-get update -o Acquire::GzipIndexes=false'
APT_INSTALL="env LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get install -y -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef --no-install-recommends"
# APT_UPGRADE="env LANG=C.UTF-8 DEBIAN_FRONTEND=noninteractive apt-get dist-upgrade -y -o Dpkg::Options::=--force-confold -o Dpkg::Options::=--force-confdef --no-install-recommends"
# APT_ADD_REPOSITORY="env LANG=C.UTF-8 apt-add-repository -y"
# Prepare container case "$VARIANT" in
info "Preparing container ..." ubuntu-19.10)
# Use uncompressed package lists. Necessary to work around # Update repositories
# "apt-show-version" problems due to usage of compressed lists in docker exec "$CONTAINER" apt update || die 1 "Unable to update repositories on '$VARIANT' using DOCKER '$DOCKER'"
# Docker containers:
# https://askubuntu.com/questions/916199/install-apt-show-versions-inside-an-ubuntu-docker-container
sudo docker exec "$CONTAINER" env LANG=C.UTF-8 sed -e "s#http://archive.ubuntu.com/ubuntu/#http://$UBUNTU_MIRROR/ubuntu/#g" -i /etc/apt/sources.list
fixme "Do not use bash in install.sh"
#sudo docker exec "$CONTAINER" bash -c "find /var/lib/apt/lists/ -maxdepth 1 -type f | xargs rm -f"
info "Updating docker's repositories for $VARIANT"
sudo docker exec "$CONTAINER" ci/travis-ci/retry.sh -t "$RETRY_MAXTRIALS" -p "$RETRY_PAUSE" -- "$APT_UPDATE"
info "Installing dependencies for $VARIANT" # Install dependencies
sudo docker exec "$CONTAINER" ci/travis-ci/retry.sh -t "$RETRY_MAXTRIALS" -p "$RETRY_PAUSE" -- "$APT_INSTALL" build-essential meson cppcheck libcap-dev clang libfuse3-dev gcc git ninja-build bison libtool autoconf pkg-config libcap-dev indent fakeroot libattr1-dev uthash-dev gzip rsync autopoint uthash-dev shellcheck ca-certificates || die "Unable to install all required dependencies" if [ -n "$PACKAGES" ]; then
docker exec "$CONTAINER" apt install -y "$PACKAGES" || die 1 "Unable to install following packages on '$CONTAINER': '$PACKAGES'"
elif [ -n "$PACKAGES" ]; then
true
else
die 256 "Resolving packages for '$CONTAINER'"
fi
;;
*) die 256 "Unsupported variant '$VARIANT' has been parsed in DOCKER '$DOCKER'"
esac
info "Fetching repository for $VARIANT" info "Fetching repository for $VARIANT"
sudo docker exec "$CONTAINER" git clone https://github.com/Kreyrock/Kreyrock.git
sudo docker exec "$CONTAINER" git clone "$REPOSITORY" || die 1 "Unable to fetch '$REPOSITORY'"
# Exherbo # Exherbo
elif [ "$VARIANT" = exherbo ]; then elif [ "$VARIANT" = exherbo ]; then

@ -3,18 +3,18 @@
# Distributed under the terms of the GNU General Public License v3 (https://www.gnu.org/licenses/gpl-3.0.en.html) or later # Distributed under the terms of the GNU General Public License v3 (https://www.gnu.org/licenses/gpl-3.0.en.html) or later
# shellcheck source=QA/travis-ci/travis-common.sh # shellcheck source=QA/travis-ci/travis-common.sh
. "$(dirname "$0")/travis-common.sh" . "QA/travis-ci/travis-common.sh"
# shellcheck source=QA/travis-ci/get-container.sh # shellcheck source=QA/travis-ci/get-container.sh
. "$(dirname "$0")/get-container.sh" . "QA/travis-ci/get-container.sh"
# Linux as-is # Linux as-is
if [ "$TRAVIS_OS_NAME" = linux ] && [ -z "$DOCKER" ] && [ -z "$QEMU" ]; then if [ "$TRAVIS_OS_NAME" = linux ] && [ -z "$DOCKER" ] && [ -z "$QEMU" ]; then
make check make check-rustlang
# Linux via Docker # Linux via Docker
elif [ "$TRAVIS_OS_NAME" = linux ] && [ -n "$DOCKER" ] && [ -z "$QEMU" ]; then elif [ "$TRAVIS_OS_NAME" = linux ] && [ -n "$DOCKER" ] && [ -z "$QEMU" ]; then
sudo docker exec "$CONTAINER" make --directory="/travis/Kreyrock" check sudo docker exec "$CONTAINER" make --directory="/travis/Zernit" check-rustlang
# MacOS X # MacOS X
elif [ "$TRAVIS_OS_NAME" = osx ]; then elif [ "$TRAVIS_OS_NAME" = osx ]; then

@ -1,3 +1,9 @@
Directory used for translations Directory used for translations
files in this directory can be translated in different format on demand if development requires it. files in this directory can be translated in different format on demand if development requires it.
### Abstract
This is expected to be crowd-sourced using Crowdin and alike
Expecting sourcing from various programming languages