2019-01-10 10:55:49 +01:00
|
|
|
dist: xenial
|
2015-04-26 04:00:50 +02:00
|
|
|
language: c
|
2016-10-05 00:13:47 +02:00
|
|
|
|
2019-02-19 18:31:34 +01:00
|
|
|
addons:
|
|
|
|
apt:
|
|
|
|
packages: &BASE_PACKAGES
|
|
|
|
# Build dependencies.
|
|
|
|
# See also `apt-cache showsrc awesome | grep -E '^(Version|Build-Depends)'`.
|
|
|
|
- libnotify-bin
|
|
|
|
- libcairo2-dev
|
|
|
|
- gir1.2-gtk-3.0
|
|
|
|
- libpango1.0-dev
|
|
|
|
- libxcb-xtest0-dev
|
|
|
|
- libxcb-icccm4-dev
|
|
|
|
- libxcb-randr0-dev
|
|
|
|
- libxcb-keysyms1-dev
|
|
|
|
- libxcb-xinerama0-dev
|
|
|
|
- libdbus-1-dev
|
|
|
|
- libxdg-basedir-dev
|
|
|
|
- libstartup-notification0-dev
|
|
|
|
- imagemagick
|
|
|
|
- libxcb1-dev
|
|
|
|
- libxcb-shape0-dev
|
|
|
|
- libxcb-util0-dev
|
|
|
|
- libx11-xcb-dev
|
|
|
|
- libxcb-cursor-dev
|
|
|
|
- libxcb-xkb-dev
|
|
|
|
- libxcb-xfixes0-dev
|
|
|
|
- libxkbcommon-dev
|
|
|
|
- libxkbcommon-x11-dev
|
|
|
|
# Deps for tests.
|
|
|
|
- dbus-x11
|
|
|
|
- xterm
|
|
|
|
- xdotool
|
2019-10-17 04:24:32 +02:00
|
|
|
- wmctrl
|
2019-02-19 18:31:34 +01:00
|
|
|
- xterm
|
|
|
|
- xvfb
|
|
|
|
- zsh
|
|
|
|
- x11-apps
|
|
|
|
# Need xorg-macros
|
|
|
|
- xutils-dev
|
|
|
|
# lgi.
|
|
|
|
- gir1.2-pango-1.0
|
|
|
|
- libgirepository1.0-dev
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
include:
|
2020-08-03 17:38:07 +02:00
|
|
|
- env: LUA=5.4 LGIVER=git
|
2019-02-19 18:31:34 +01:00
|
|
|
|
|
|
|
env:
|
2015-07-23 23:28:39 +02:00
|
|
|
global:
|
2016-05-01 18:06:18 +02:00
|
|
|
# Secure GH_APIDOC_TOKEN to push to awesomeWM/apidoc.
|
|
|
|
- secure: "R/HYDclnws1I1+v9Yjt+RKa4CsFhbBT9tiwE3EfPhEj2KCYX4sFRMxuZvLf5sq0XWdrQaPhQ54fgAZGr3f054JKRXcTB0g9J6nhSHz9kIjPh446gafUhEeDQcZRwM/MeCWiwFIkiZm6smYoDFE9JTWu6quNV+lQ4kcVDOp2ibEc="
|
2015-07-23 23:28:39 +02:00
|
|
|
|
2015-05-26 16:05:07 +02:00
|
|
|
before_install:
|
2017-01-03 14:29:10 +01:00
|
|
|
- if [ "$BUILD_APIDOC" = true ] && [ -n "$DO_COVERAGE" ]; then echo "BUILD_APIDOC and DO_COVERAGE are not meant to be used together." >&2; exit 1; fi
|
2015-10-16 16:48:37 +02:00
|
|
|
- if [ -z $LUAINCLUDE ]; then LUAINCLUDE=/usr/include/${LUANAME}; fi
|
2016-01-24 15:52:29 +01:00
|
|
|
- if [ -z $LUALIBRARY ]; then LUALIBRARY=/usr/lib/x86_64-linux-gnu/lib${LUANAME}.so; fi
|
2015-05-26 16:05:07 +02:00
|
|
|
- cmake --version
|
|
|
|
|
2015-04-26 04:00:50 +02:00
|
|
|
install:
|
2018-04-04 11:28:50 +02:00
|
|
|
- sudo gem install asciidoctor
|
2016-10-30 18:47:52 +01:00
|
|
|
|
2020-08-03 17:11:25 +02:00
|
|
|
- |
|
|
|
|
(echo '#!/bin/sh' ; echo 'set -x' ; echo 'gcc -shared -Wl,--no-undefined -o "$@" -ldl -lm') > /tmp/myar
|
|
|
|
chmod a+x /tmp/myar
|
|
|
|
(cd /tmp
|
|
|
|
wget http://www.lua.org/ftp/lua-5.4.0.tar.gz -O lua.tar.gz
|
2020-08-03 17:29:03 +02:00
|
|
|
(tar -xvzf lua.tar.gz ; sleep 2)
|
|
|
|
cd lua-5.4.*/src \
|
2020-08-03 17:11:25 +02:00
|
|
|
&& make SYSCFLAGS="-DLUA_USE_LINUX -ULUA_COMPAT_5_3 -DLUA_USE_APICHECK -Dlua_assert=assert" SYSLIBS="-Wl,-E -ldl -lreadline" LUA_A=liblua.so MYCFLAGS="-fPIC" RANLIB=: AR="/tmp/myar" liblua.so \
|
|
|
|
&& cd .. \
|
|
|
|
&& sudo make INSTALL_TOP=/usr/ INSTALL_INC=${LUAINCLUDE} TO_LIB=liblua.so linux install
|
|
|
|
)
|
2016-01-24 15:52:29 +01:00
|
|
|
- |
|
2019-02-19 18:11:27 +01:00
|
|
|
# Install Lua (per env).
|
2019-01-10 10:55:49 +01:00
|
|
|
if [[ "$LUANAME" == "luajit-2.0" ]]; then
|
2016-04-06 01:29:57 +02:00
|
|
|
# "Create" /usr/bin/lua if needed (Yup, this is a bad hack)
|
|
|
|
if [ ! -e "/usr/bin/lua" ]; then sudo ln -s /usr/bin/luajit /usr/bin/lua; fi
|
2016-02-11 21:40:22 +01:00
|
|
|
else
|
2019-01-10 10:55:49 +01:00
|
|
|
# lua5.3 does not install /usr/bin/lua, but lua5.1/lua5.2 do.
|
|
|
|
if [ ! -e "/usr/bin/lua" ]; then sudo ln -s /usr/bin/${LUANAME} /usr/bin/lua; fi
|
2016-02-11 21:40:22 +01:00
|
|
|
fi
|
2019-01-10 10:55:49 +01:00
|
|
|
- lua -v
|
2016-01-24 15:52:29 +01:00
|
|
|
|
2015-04-26 04:00:50 +02:00
|
|
|
# Install luarocks (for the selected Lua version).
|
2016-04-06 01:48:30 +02:00
|
|
|
- |
|
2020-08-03 17:33:40 +02:00
|
|
|
travis_retry wget https://github.com/luarocks/luarocks/archive/v3.3.1.tar.gz
|
2020-08-03 17:35:39 +02:00
|
|
|
tar xf v3.3.1.tar.gz -C /tmp
|
2017-08-16 10:57:23 +02:00
|
|
|
(cd /tmp/luarocks-* \
|
2016-08-14 02:25:20 +02:00
|
|
|
&& ./configure --lua-version=$LUA --with-lua-include=${LUAINCLUDE} ${LUAROCKS_ARGS} \
|
|
|
|
&& make build \
|
|
|
|
&& sudo make install)
|
2015-04-26 04:00:50 +02:00
|
|
|
|
2020-08-03 17:38:07 +02:00
|
|
|
- |
|
|
|
|
if [[ "$LGIVER" == "git" ]]; then
|
|
|
|
# Build LGI from git:
|
|
|
|
travis_retry git clone https://github.com/pavouk/lgi.git lgi
|
|
|
|
(cd lgi
|
|
|
|
make LUA_INCDIR=${LUAINCLUDE} LUA_VERSION=${LUA} LUA_CFLAGS="-I${LUAINCLUDE}"
|
|
|
|
sudo make \
|
|
|
|
LUA_LIBDIR=/usr/lib/lua/${LUA} \
|
|
|
|
LUA_SHAREDIR=/usr/share/lua/${LUA} \
|
|
|
|
LUA_VERSION=${LUA} \
|
|
|
|
install)
|
|
|
|
else
|
|
|
|
# Install LGI (for the selected version):
|
|
|
|
travis_retry sudo luarocks install lgi $LGIVER
|
|
|
|
fi
|
2015-04-26 04:00:50 +02:00
|
|
|
|
2016-02-07 15:29:04 +01:00
|
|
|
# Install busted for "make check-unit".
|
2015-10-16 16:48:37 +02:00
|
|
|
- travis_retry sudo luarocks install busted
|
2016-11-27 15:24:04 +01:00
|
|
|
# Install luacheck for "make check-qa".
|
2016-12-18 11:20:55 +01:00
|
|
|
- if [ "$DO_CHECKQA" = 1 ]; then travis_retry sudo luarocks install luacheck; fi
|
2017-02-06 18:35:20 +01:00
|
|
|
# Install depgraph for "make check-qa".
|
|
|
|
- if [ "$DO_CHECKQA" = 1 ]; then travis_retry sudo luarocks install depgraph; fi
|
2015-04-26 04:00:50 +02:00
|
|
|
|
2017-04-09 18:18:42 +02:00
|
|
|
# Install ldoc for building docs and check-ldoc-warnings.
|
2016-12-30 15:38:50 +01:00
|
|
|
- |
|
2017-04-09 18:18:42 +02:00
|
|
|
if [ "$BUILD_APIDOC" = "true" ] || [ "$DO_CHECKQA" = 1 ]; then
|
2016-12-30 15:38:50 +01:00
|
|
|
travis_retry sudo luarocks install ldoc
|
|
|
|
fi
|
2015-07-10 13:17:50 +02:00
|
|
|
|
2016-06-11 18:47:29 +02:00
|
|
|
# Install dependencies for code coverage testing.
|
2017-08-16 00:48:42 +02:00
|
|
|
- if [ -n "$DO_COVERAGE" ]; then sudo luarocks install cluacov; fi
|
2016-07-08 22:46:41 +02:00
|
|
|
- if [ "$DO_COVERAGE" = "coveralls" ]; then sudo luarocks install luacov-coveralls; fi
|
2016-02-06 15:23:28 +01:00
|
|
|
|
2015-07-24 01:01:38 +02:00
|
|
|
# Determine custom version.
|
2015-07-27 15:57:11 +02:00
|
|
|
- export AWESOME_VERSION="${TRAVIS_BRANCH}-g$(git rev-parse --short HEAD)"
|
2017-03-08 21:18:33 +01:00
|
|
|
- |
|
|
|
|
if [ "$TRAVIS_PULL_REQUEST" != false ] && [ "$TEST_PREV_COMMITS" = 1 ]; then
|
|
|
|
AWESOME_VERSION="${AWESOME_VERSION}-PR${TRAVIS_PULL_REQUEST}"
|
|
|
|
elif [ "$TRAVIS_PULL_REQUEST" != false ]; then
|
|
|
|
AWESOME_VERSION="v9999-PR${TRAVIS_PULL_REQUEST}";
|
|
|
|
fi
|
2016-06-11 18:47:29 +02:00
|
|
|
# function for codecov support
|
2017-01-03 14:29:10 +01:00
|
|
|
- if [ "$DO_COVERAGE" = "codecov" ]; then travis_retry wget -O /tmp/codecov-bash https://codecov.io/bash; fi
|
2016-06-11 18:47:29 +02:00
|
|
|
- |
|
|
|
|
do_codecov() {
|
2017-01-03 14:29:10 +01:00
|
|
|
echo "== do_codecov in $PWD: $*: build/luacov.stats.out: =="
|
2016-06-11 18:47:29 +02:00
|
|
|
if [ "$DO_COVERAGE" = "codecov" ]; then
|
2017-01-08 10:08:30 +01:00
|
|
|
test -f build/luacov.stats.out || { echo 'build/luacov.stats.out does not exist.'; return 1; }
|
2017-01-05 14:05:03 +01:00
|
|
|
luacov || return 1
|
2019-02-14 18:46:01 +01:00
|
|
|
travis_retry bash /tmp/codecov-bash -f build/luacov.report.out -X gcov -X coveragepy -F luacov -e LUANAME,LGIVER || return 1
|
2019-01-10 10:56:39 +01:00
|
|
|
rm build/luacov.report.out build/luacov.stats.out
|
2016-06-11 18:47:29 +02:00
|
|
|
fi
|
2016-08-14 02:25:20 +02:00
|
|
|
return 0
|
2016-06-11 18:47:29 +02:00
|
|
|
}
|
2017-05-01 17:24:43 +02:00
|
|
|
- |
|
|
|
|
do_codecov_gcov() {
|
|
|
|
echo "== do_codecov_gcov in $PWD: $*: =="
|
|
|
|
if [ "$DO_COVERAGE" = "codecov" ]; then
|
2019-01-10 23:06:54 +01:00
|
|
|
# Report coverage for each .gcno file separately.
|
|
|
|
# gcov will create .gcov files for the same source (e.g. for
|
|
|
|
# globalconf.h from awesome.c.gcno and event.c.gcno).
|
|
|
|
i=0
|
|
|
|
set -x
|
|
|
|
(
|
|
|
|
cd build
|
|
|
|
find -path "*/lgi-check.dir" -prune -o \( -name '*.gcno' -print \) | while read -r gcno; do
|
|
|
|
gcov -pb "$gcno"
|
|
|
|
|
|
|
|
mkdir gcov.$(( ++i ))
|
|
|
|
mv *.gcov "gcov.$i"
|
|
|
|
|
|
|
|
# Delete any files for /usr.
|
|
|
|
# They are not relevant and might cause "Invalid path part" errors
|
|
|
|
# with Code Climate.
|
|
|
|
find "gcov.$i" -maxdepth 1 -type f -name '#usr#*.gcov' -delete
|
|
|
|
done
|
|
|
|
|
|
|
|
# Upload to Codecov.
|
2019-02-14 18:46:01 +01:00
|
|
|
travis_retry bash /tmp/codecov-bash -X gcov -X coveragepy -F gcov -e LUANAME,LGIVER
|
2019-01-10 23:06:54 +01:00
|
|
|
)
|
2017-05-01 17:24:43 +02:00
|
|
|
fi
|
|
|
|
return 0
|
|
|
|
}
|
2015-07-24 01:01:38 +02:00
|
|
|
|
2016-07-05 22:14:41 +02:00
|
|
|
# Functions for custom Travis folds.
|
|
|
|
- |
|
|
|
|
travis_fold_start() {
|
2016-12-25 15:26:09 +01:00
|
|
|
travis_fold start "$1"
|
2016-07-05 22:14:41 +02:00
|
|
|
travis_fold_current="$1"
|
|
|
|
}
|
|
|
|
travis_fold_end() {
|
2016-12-25 15:26:09 +01:00
|
|
|
travis_fold end "$travis_fold_current"
|
2016-07-05 22:14:41 +02:00
|
|
|
}
|
|
|
|
travis_run_in_fold() {
|
|
|
|
travis_fold_start "$1"
|
|
|
|
shift
|
2017-07-01 14:15:12 +02:00
|
|
|
"$@" || return 1
|
2016-07-05 22:14:41 +02:00
|
|
|
travis_fold_end
|
2017-02-04 16:35:53 +01:00
|
|
|
return 0
|
2016-07-05 22:14:41 +02:00
|
|
|
}
|
2015-04-26 04:00:50 +02:00
|
|
|
script:
|
2019-06-13 06:35:32 +02:00
|
|
|
- if [ "$MANUAL_SCREENS" != "1" ]; then export MANUAL_SCREENS=0; fi
|
|
|
|
- export CMAKE_ARGS="-DLUA_LIBRARY=${LUALIBRARY} -D LUA_INCLUDE_DIR=${LUAINCLUDE} -D OVERRIDE_VERSION=$AWESOME_VERSION -D STRICT_TESTS=true -D DO_COVERAGE=$DO_COVERAGE -D TEST_MANUAL_SCREENS=$MANUAL_SCREENS -D CMAKE_C_FLAGS=-Werror"
|
2017-02-15 00:46:27 +01:00
|
|
|
- |
|
|
|
|
if [ "$EMPTY_THEME_WHILE_LOADING" = 1 ]; then
|
|
|
|
# Break beautiful so that trying to access the theme before beautiful.init() causes an error
|
|
|
|
sed -i -e 's/theme = {}/theme = setmetatable({}, { __index = function() error("May not access theme before beautiful.init()") end })/' lib/beautiful/init.lua \
|
|
|
|
&& grep -q 'May not access' lib/beautiful/init.lua
|
|
|
|
fi
|
2016-05-08 18:07:42 +02:00
|
|
|
- |
|
2017-01-03 14:29:10 +01:00
|
|
|
set -e
|
2016-05-08 18:07:42 +02:00
|
|
|
if [ -n "$BUILD_IN_DIR" ]; then
|
2016-07-05 22:14:41 +02:00
|
|
|
# Explicitly remove the Makefile to not build from the src dir accidentally.
|
|
|
|
rm Makefile
|
|
|
|
SOURCE_DIRECTORY="$PWD"
|
|
|
|
mkdir "$BUILD_IN_DIR"
|
|
|
|
cd "$BUILD_IN_DIR"
|
|
|
|
travis_run_in_fold "build_in_dir" cmake $CMAKE_ARGS "$SOURCE_DIRECTORY"
|
|
|
|
fi
|
|
|
|
- travis_run_in_fold "make" make
|
|
|
|
- |
|
|
|
|
if [ "$TRAVIS_TEST_RESULT" = 0 ]; then
|
|
|
|
travis_run_in_fold "make.install" sudo env PATH=$PATH make install
|
|
|
|
awesome --version
|
2016-05-08 18:07:42 +02:00
|
|
|
fi
|
2017-08-14 17:18:46 +02:00
|
|
|
# Run checks.
|
2016-06-11 18:47:29 +02:00
|
|
|
- |
|
|
|
|
if [ "$TRAVIS_TEST_RESULT" = 0 ]; then
|
2017-10-24 00:29:22 +02:00
|
|
|
set -ex
|
2017-08-16 00:48:42 +02:00
|
|
|
if [ -n "$DO_COVERAGE" ]; then
|
2016-07-05 22:14:41 +02:00
|
|
|
travis_fold_start "DO_COVERAGE"
|
2017-01-03 14:29:10 +01:00
|
|
|
|
|
|
|
# Run tests/examples explicitly.
|
2019-02-19 00:15:19 +01:00
|
|
|
make check-examples || exit 1
|
2017-01-03 14:29:10 +01:00
|
|
|
do_codecov samples
|
|
|
|
|
2019-01-10 13:30:58 +01:00
|
|
|
make check-unit || exit 1
|
2017-07-01 14:15:12 +02:00
|
|
|
do_codecov unittests
|
2017-08-10 13:21:54 +02:00
|
|
|
make check-integration || exit 1
|
2017-07-01 14:15:12 +02:00
|
|
|
do_codecov functionaltests
|
2019-01-10 19:08:36 +01:00
|
|
|
make check-themes || exit 1
|
|
|
|
do_codecov themes
|
2017-07-01 14:15:12 +02:00
|
|
|
do_codecov_gcov c_code
|
|
|
|
|
2016-07-05 22:14:41 +02:00
|
|
|
travis_fold_end
|
2016-06-05 16:12:57 +02:00
|
|
|
else
|
2019-02-19 00:15:19 +01:00
|
|
|
# TODO: does not run check-examples. Should it?
|
2016-11-27 15:24:04 +01:00
|
|
|
travis_run_in_fold "make.check-unit" make check-unit
|
|
|
|
travis_run_in_fold "make.check-integration" make check-integration
|
2017-08-14 17:18:46 +02:00
|
|
|
travis_run_in_fold "make.check-themes" make check-themes
|
2016-07-05 22:14:41 +02:00
|
|
|
fi
|
2017-10-24 00:29:22 +02:00
|
|
|
set +x
|
2016-07-05 22:14:41 +02:00
|
|
|
fi
|
2016-11-27 15:24:04 +01:00
|
|
|
# Run check-qa.
|
|
|
|
- |
|
|
|
|
if [ "$DO_CHECKQA" = 1 ]; then
|
|
|
|
travis_run_in_fold "make.check-qa" make check-qa
|
|
|
|
fi
|
2016-07-05 22:14:41 +02:00
|
|
|
- |
|
|
|
|
if [ "$TEST_PREV_COMMITS" = 1 ] && ! [ "$TRAVIS_PULL_REQUEST" = false ]; then
|
2017-11-18 01:52:48 +01:00
|
|
|
set -e
|
2016-07-05 22:14:41 +02:00
|
|
|
# Check each commit separately (to make git-bisect less annoying).
|
2016-12-25 13:13:33 +01:00
|
|
|
# Fix Travis' commit range (https://github.com/travis-ci/travis-ci/issues/4596).
|
|
|
|
commit_range="${TRAVIS_COMMIT_RANGE/.../..}"
|
|
|
|
echo "Testing previous commits ($commit_range)"
|
|
|
|
rev_list="$(git rev-list --bisect-all $commit_range)"
|
2016-07-05 22:14:41 +02:00
|
|
|
echo "rev-list: $rev_list"
|
2016-12-25 13:13:33 +01:00
|
|
|
commits="$(echo "$rev_list" | grep -v 'dist=0' | cut -d\ -f 1)"
|
|
|
|
n="$(echo "$commits" | wc -l)"
|
|
|
|
echo "Testing $n commits: $commits"
|
2016-07-05 22:14:41 +02:00
|
|
|
i=0
|
|
|
|
failed=
|
|
|
|
for commit in $commits; do
|
|
|
|
i=$((i+1))
|
|
|
|
travis_fold_start "test_commit_${commit}_.$i.$n"
|
|
|
|
echo "Testing commit $commit"
|
2019-06-08 23:47:39 +02:00
|
|
|
git reset --hard # Some files are updated when compiling...
|
2016-07-05 22:14:41 +02:00
|
|
|
git checkout "$commit"
|
|
|
|
git --no-pager show --stat
|
2019-01-11 17:04:04 +01:00
|
|
|
|
2017-08-16 00:48:42 +02:00
|
|
|
if ! make all check CMAKE_ARGS+="-D DO_COVERAGE=0"; then
|
2016-07-05 22:14:41 +02:00
|
|
|
failed="$failed $commit"
|
|
|
|
fi
|
|
|
|
travis_fold_end
|
|
|
|
done
|
2016-12-28 02:34:20 +01:00
|
|
|
|
|
|
|
git checkout -qf FETCH_HEAD
|
2016-07-05 22:14:41 +02:00
|
|
|
if [ -n "$failed" ]; then
|
2016-12-28 02:34:20 +01:00
|
|
|
echo "Checks failed for these commits:"
|
2018-05-21 09:01:09 +02:00
|
|
|
for c in $failed; do
|
2016-12-28 02:34:20 +01:00
|
|
|
git log -1 --pretty="%h %s (%an, %ad)" "$c"
|
|
|
|
done
|
2016-08-14 02:25:20 +02:00
|
|
|
false
|
2016-06-05 16:12:57 +02:00
|
|
|
fi
|
2016-02-06 17:18:23 +01:00
|
|
|
fi
|
2015-07-23 23:28:39 +02:00
|
|
|
|
2020-08-03 17:25:13 +02:00
|
|
|
after_failure:
|
|
|
|
- sleep 10
|
|
|
|
|
2015-07-23 23:28:39 +02:00
|
|
|
after_success:
|
2015-07-27 15:57:11 +02:00
|
|
|
# Push updated API docs for relevant branches, e.g. non-PRs builds on master.
|
2015-10-10 23:08:20 +02:00
|
|
|
- if [ "$BUILD_APIDOC" = "true" ]; then build-utils/travis-apidoc.sh; fi
|
2016-02-06 15:23:28 +01:00
|
|
|
# Push code coverage information
|
2017-01-03 14:29:10 +01:00
|
|
|
- |
|
|
|
|
set -e
|
|
|
|
if [ "$DO_COVERAGE" = "coveralls" ]; then
|
2017-01-08 10:08:30 +01:00
|
|
|
test -f build/luacov.stats.out || { echo 'build/luacov.stats.out does not exist.'; return 1; }
|
2017-01-03 14:29:10 +01:00
|
|
|
luacov-coveralls --verbose --merge
|
|
|
|
fi
|
2020-08-03 17:25:13 +02:00
|
|
|
- sleep 10
|