diff options
author | iphydf <iphydf@users.noreply.github.com> | 2018-06-24 22:56:07 +0000 |
---|---|---|
committer | iphydf <iphydf@users.noreply.github.com> | 2018-07-01 08:35:44 +0000 |
commit | 1a54be06cd359257478b584611f34058d21fe723 (patch) | |
tree | db3d6ca2dfa2a87ae2efdac6e412c2b780a64009 /other | |
parent | 706fad1ce88c2104009a3835ee343ff9d8ec8b79 (diff) |
Simplify Travis CI builds.
Have one script per build. This means more duplication between the
scripts, but it's much easier to understand and to run locally.
Diffstat (limited to 'other')
-rw-r--r-- | other/bootstrap_daemon/src/Makefile.inc | 1 | ||||
-rw-r--r-- | other/docker/windows/build_toxcore.sh | 10 | ||||
-rw-r--r-- | other/travis/autotools-linux-install | 14 | ||||
-rwxr-xr-x | other/travis/autotools-script | 35 | ||||
-rw-r--r-- | other/travis/env-linux.sh | 27 | ||||
-rw-r--r-- | other/travis/env-osx.sh | 21 | ||||
-rw-r--r-- | other/travis/env-windows.sh | 36 | ||||
-rwxr-xr-x | other/travis/freebsd-script-stage1 | 4 | ||||
-rwxr-xr-x | other/travis/installmd-windows-install | 12 | ||||
-rwxr-xr-x | other/travis/installmd-windows-script | 12 | ||||
-rwxr-xr-x | other/travis/phase | 32 | ||||
-rwxr-xr-x | other/travis/tox-bootstrapd-docker-linux-script | 63 | ||||
-rwxr-xr-x | other/travis/toxcore-after_failure | 7 | ||||
-rwxr-xr-x | other/travis/toxcore-linux-after_script | 8 | ||||
-rwxr-xr-x | other/travis/toxcore-linux-install | 26 | ||||
-rwxr-xr-x | other/travis/toxcore-osx-install | 6 | ||||
-rwxr-xr-x | other/travis/toxcore-windows-install | 7 |
17 files changed, 8 insertions, 313 deletions
diff --git a/other/bootstrap_daemon/src/Makefile.inc b/other/bootstrap_daemon/src/Makefile.inc index 1c313d44..6b820be0 100644 --- a/other/bootstrap_daemon/src/Makefile.inc +++ b/other/bootstrap_daemon/src/Makefile.inc | |||
@@ -33,6 +33,7 @@ tox_bootstrapd_LDADD = \ | |||
33 | libtoxcore.la \ | 33 | libtoxcore.la \ |
34 | $(LIBCONFIG_LIBS) \ | 34 | $(LIBCONFIG_LIBS) \ |
35 | $(LIBSODIUM_LIBS) \ | 35 | $(LIBSODIUM_LIBS) \ |
36 | $(NACL_OBJECTS) \ | ||
36 | $(NACL_LIBS) | 37 | $(NACL_LIBS) |
37 | 38 | ||
38 | endif | 39 | endif |
diff --git a/other/docker/windows/build_toxcore.sh b/other/docker/windows/build_toxcore.sh index a3830455..da465eb1 100644 --- a/other/docker/windows/build_toxcore.sh +++ b/other/docker/windows/build_toxcore.sh | |||
@@ -1,4 +1,4 @@ | |||
1 | #!/usr/bin/env sh | 1 | #!/bin/sh |
2 | 2 | ||
3 | set -e -x | 3 | set -e -x |
4 | 4 | ||
@@ -57,9 +57,13 @@ build() | |||
57 | -DCMAKE_INSTALL_PREFIX="${STATIC_TOXCORE_PREFIX_DIR}" \ | 57 | -DCMAKE_INSTALL_PREFIX="${STATIC_TOXCORE_PREFIX_DIR}" \ |
58 | -DENABLE_SHARED=OFF \ | 58 | -DENABLE_SHARED=OFF \ |
59 | -DENABLE_STATIC=ON \ | 59 | -DENABLE_STATIC=ON \ |
60 | -DCMAKE_C_FLAGS="${CMAKE_C_FLAGS}" \ | ||
61 | -DCMAKE_CXX_FLAGS="${CMAKE_CXX_FLAGS}" \ | ||
62 | -DCMAKE_EXE_LINKER_FLAGS="${CMAKE_EXE_LINKER_FLAGS}" \ | ||
63 | -DCMAKE_SHARED_LINKER_FLAGS="${CMAKE_SHARED_LINKER_FLAGS}" \ | ||
60 | ${EXTRA_CMAKE_FLAGS} \ | 64 | ${EXTRA_CMAKE_FLAGS} \ |
61 | .. | 65 | .. |
62 | cmake --build . --target install | 66 | cmake --build . --target install -- -j$(nproc) |
63 | 67 | ||
64 | if [ "${ENABLE_TEST}" = "true" ]; then | 68 | if [ "${ENABLE_TEST}" = "true" ]; then |
65 | rm -rf /root/.wine | 69 | rm -rf /root/.wine |
@@ -79,7 +83,7 @@ build() | |||
79 | if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then | 83 | if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then |
80 | set +e | 84 | set +e |
81 | fi | 85 | fi |
82 | cmake --build . --target test | 86 | cmake --build . --target test -- ARGS="-j50" |
83 | if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then | 87 | if [ "${ALLOW_TEST_FAILURE}" = "true" ]; then |
84 | set -e | 88 | set -e |
85 | fi | 89 | fi |
diff --git a/other/travis/autotools-linux-install b/other/travis/autotools-linux-install deleted file mode 100644 index ca0adff7..00000000 --- a/other/travis/autotools-linux-install +++ /dev/null | |||
@@ -1,14 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | . other/travis/toxcore-linux-install | ||
4 | |||
5 | # Also install vanilla NaCl | ||
6 | [ -f $CACHE_DIR/lib/amd64/libnacl.a ] || { | ||
7 | curl https://hyperelliptic.org/nacl/nacl-20110221.tar.bz2 | tar jx | ||
8 | cd nacl-20110221 # pushd | ||
9 | "./do" | ||
10 | # "make install" | ||
11 | mv build/*/include/* $CACHE_DIR/include | ||
12 | mv build/*/lib/* $CACHE_DIR/lib | ||
13 | cd - # popd | ||
14 | } | ||
diff --git a/other/travis/autotools-script b/other/travis/autotools-script deleted file mode 100755 index d72ec2a9..00000000 --- a/other/travis/autotools-script +++ /dev/null | |||
@@ -1,35 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if perl -e ' | ||
4 | use Socket qw(PF_INET6 SOCK_STREAM pack_sockaddr_in6 IN6ADDR_LOOPBACK); | ||
5 | |||
6 | socket(S, PF_INET6, SOCK_STREAM, 0) || exit 1; | ||
7 | bind(S, pack_sockaddr_in6(0, IN6ADDR_LOOPBACK)) || exit 1; | ||
8 | '; then | ||
9 | IPV6_FLAG="--enable-ipv6" | ||
10 | else | ||
11 | IPV6_FLAG="--disable-ipv6" | ||
12 | fi | ||
13 | |||
14 | # Build toxcore with some custom flags here. Note that this does *not* run the | ||
15 | # tests, so any flags passed here are irrelevant to testing. This only checks | ||
16 | # that we can build toxcore with the specified flags. Tests run with default | ||
17 | # configure flags. | ||
18 | ./autogen.sh | ||
19 | ./configure \ | ||
20 | --with-nacl-libs=$CACHE_DIR/lib/amd64 \ | ||
21 | --with-nacl-headers=$CACHE_DIR/include/amd64 \ | ||
22 | --enable-nacl \ | ||
23 | --enable-daemon \ | ||
24 | --enable-logging \ | ||
25 | $IPV6_FLAG \ | ||
26 | --with-log-level=TRACE | ||
27 | |||
28 | # We use make instead of RUN $MAKE here, because the autotools build will only | ||
29 | # ever run natively on the Linux container, never on a Windows cross compilation | ||
30 | # docker instance or an OSX machine. | ||
31 | make -j$NPROC -k | ||
32 | |||
33 | # This runs `make check` with the default configure flags, not with the ones | ||
34 | # above. | ||
35 | TESTS $MAX_TEST_RETRIES make distcheck -j$NPROC -k | ||
diff --git a/other/travis/env-linux.sh b/other/travis/env-linux.sh deleted file mode 100644 index 9f25e911..00000000 --- a/other/travis/env-linux.sh +++ /dev/null | |||
@@ -1,27 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | export PATH=/opt/ghc/7.8.4/bin:/opt/cabal/1.18/bin:/opt/alex/3.1.7/bin:/opt/happy/1.19.5/bin:$PATH | ||
4 | export PATH=$HOME/.cabal/bin:$PATH | ||
5 | |||
6 | CMAKE=cmake | ||
7 | # Asan is disabled because it's currently broken on Travis. | ||
8 | # See https://github.com/travis-ci/travis-ci/issues/9033. | ||
9 | CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DASAN=OFF" | ||
10 | NPROC=`nproc` | ||
11 | CURDIR=$PWD | ||
12 | RUN_TESTS=true | ||
13 | |||
14 | RUN() { | ||
15 | "$@" | ||
16 | } | ||
17 | |||
18 | TESTS() { | ||
19 | COUNT="$1"; shift | ||
20 | "$@" || { | ||
21 | if [ $COUNT -gt 1 ]; then | ||
22 | TESTS `expr $COUNT - 1` "$@" | ||
23 | else | ||
24 | false | ||
25 | fi | ||
26 | } | ||
27 | } | ||
diff --git a/other/travis/env-osx.sh b/other/travis/env-osx.sh deleted file mode 100644 index af1794f4..00000000 --- a/other/travis/env-osx.sh +++ /dev/null | |||
@@ -1,21 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | CMAKE=cmake | ||
4 | CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS" | ||
5 | NPROC=`sysctl -n hw.ncpu` | ||
6 | CURDIR=$PWD | ||
7 | |||
8 | RUN() { | ||
9 | "$@" | ||
10 | } | ||
11 | |||
12 | TESTS() { | ||
13 | COUNT="$1"; shift | ||
14 | "$@" || { | ||
15 | if [ $COUNT -gt 1 ]; then | ||
16 | TESTS `expr $COUNT - 1` "$@" | ||
17 | else | ||
18 | false | ||
19 | fi | ||
20 | } | ||
21 | } | ||
diff --git a/other/travis/env-windows.sh b/other/travis/env-windows.sh deleted file mode 100644 index 525630ae..00000000 --- a/other/travis/env-windows.sh +++ /dev/null | |||
@@ -1,36 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | CMAKE_EXTRA_FLAGS="$CMAKE_EXTRA_FLAGS -DBOOTSTRAP_DAEMON=OFF -DERROR_ON_WARNING=OFF" | ||
4 | |||
5 | if [ "$JOB" = "toxcore" ]; then | ||
6 | CMAKE=$ARCH-w64-mingw32.shared-cmake | ||
7 | NPROC=`nproc` | ||
8 | CURDIR=/work | ||
9 | RUN_TESTS=true | ||
10 | |||
11 | RUN() { | ||
12 | ./dockcross "$@" | ||
13 | } | ||
14 | |||
15 | TESTS() { | ||
16 | shift # Ignore test run count. | ||
17 | |||
18 | # Download Microsoft DLLs. | ||
19 | curl http://www.dlldump.com/dllfiles/I/iphlpapi.dll -o _build/iphlpapi.dll | ||
20 | curl http://www.dlldump.com/dllfiles/W/ws2_32.dll -o _build/ws2_32.dll | ||
21 | |||
22 | # Copy our dependency DLLs. | ||
23 | ./dockcross sh -c 'cp $WINEDLLPATH/*.dll _build' | ||
24 | |||
25 | # Run tests in docker. | ||
26 | ./dockcross "$@" || { | ||
27 | cat _build/Testing/Temporary/LastTest.log | ||
28 | # Ignore test failures on Windows builds for now. | ||
29 | #false | ||
30 | } | ||
31 | } | ||
32 | elif [ "$JOB" = "installmd" ]; then | ||
33 | true | ||
34 | else | ||
35 | echo "Unsupported JOB=$JOB" | ||
36 | fi | ||
diff --git a/other/travis/freebsd-script-stage1 b/other/travis/freebsd-script-stage1 deleted file mode 100755 index ce16aea1..00000000 --- a/other/travis/freebsd-script-stage1 +++ /dev/null | |||
@@ -1,4 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # We don't want toxcore-script to run yet, it should be done during FreeBSD stage 2 | ||
4 | exit 0 | ||
diff --git a/other/travis/installmd-windows-install b/other/travis/installmd-windows-install deleted file mode 100755 index 8a85bbbd..00000000 --- a/other/travis/installmd-windows-install +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | cd other/docker/windows | ||
4 | |||
5 | docker build \ | ||
6 | --build-arg SUPPORT_ARCH_i686=${SUPPORT_ARCH_i686} \ | ||
7 | --build-arg SUPPORT_ARCH_x86_64=${SUPPORT_ARCH_x86_64} \ | ||
8 | --build-arg SUPPORT_TEST=${SUPPORT_TEST} \ | ||
9 | -t toxcore \ | ||
10 | . | ||
11 | |||
12 | cd - | ||
diff --git a/other/travis/installmd-windows-script b/other/travis/installmd-windows-script deleted file mode 100755 index 906a7f1d..00000000 --- a/other/travis/installmd-windows-script +++ /dev/null | |||
@@ -1,12 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | docker run \ | ||
4 | -e ALLOW_TEST_FAILURE=${ALLOW_TEST_FAILURE} \ | ||
5 | -e ENABLE_ARCH_i686=${ENABLE_ARCH_i686} \ | ||
6 | -e ENABLE_ARCH_x86_64=${ENABLE_ARCH_x86_64} \ | ||
7 | -e ENABLE_TEST=${ENABLE_TEST} \ | ||
8 | -e EXTRA_CMAKE_FLAGS="${CMAKE_EXTRA_FLAGS} -DDEBUG=ON -DTEST_TIMEOUT_SECONDS=90" \ | ||
9 | -v ${PWD}:/toxcore \ | ||
10 | -v ${PWD}/result:/prefix \ | ||
11 | --rm \ | ||
12 | toxcore | ||
diff --git a/other/travis/phase b/other/travis/phase deleted file mode 100755 index cb9c2abf..00000000 --- a/other/travis/phase +++ /dev/null | |||
@@ -1,32 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | set -e -u -x | ||
4 | |||
5 | JOB="$1" | ||
6 | ENV="$2" | ||
7 | PHASE="$3" | ||
8 | STAGE="" | ||
9 | |||
10 | set +u | ||
11 | if [ ! -z "$4" ] ; then | ||
12 | STAGE="$4" | ||
13 | fi | ||
14 | set -u | ||
15 | |||
16 | . "other/travis/env.sh" | ||
17 | . "other/travis/env-$ENV.sh" | ||
18 | |||
19 | try_source() { | ||
20 | SCRIPT="other/travis/$1" | ||
21 | if [ -f "$SCRIPT" ]; then | ||
22 | . "$SCRIPT" | ||
23 | fi | ||
24 | if [ ! -z "$STAGE" ] && [ -f "$SCRIPT-$STAGE" ]; then | ||
25 | . "$SCRIPT-$STAGE" | ||
26 | fi | ||
27 | } | ||
28 | |||
29 | try_source "$PHASE" | ||
30 | try_source "$ENV-$PHASE" | ||
31 | try_source "$JOB-$PHASE" | ||
32 | try_source "$JOB-$ENV-$PHASE" | ||
diff --git a/other/travis/tox-bootstrapd-docker-linux-script b/other/travis/tox-bootstrapd-docker-linux-script deleted file mode 100755 index bb3b5422..00000000 --- a/other/travis/tox-bootstrapd-docker-linux-script +++ /dev/null | |||
@@ -1,63 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Copy source code to other/bootstrap_daemon/docker/c-toxcore | ||
4 | OLD_PWD=$PWD | ||
5 | cd /tmp | ||
6 | cp -a $OLD_PWD c-toxcore | ||
7 | mv c-toxcore $OLD_PWD/other/bootstrap_daemon/docker | ||
8 | cd $OLD_PWD | ||
9 | ls -lbh other/bootstrap_daemon/docker | ||
10 | ls -lbh other/bootstrap_daemon/docker/c-toxcore | ||
11 | |||
12 | cd other/bootstrap_daemon | ||
13 | |||
14 | # Make Docker container use our current source code instead of master branch | ||
15 | sed -i "s|WORKDIR /tmp/tox|WORKDIR /tmp/tox\nADD /c-toxcore ./c-toxcore/|g" docker/Dockerfile | ||
16 | sed -i '/git clone/d' docker/Dockerfile | ||
17 | |||
18 | cat docker/Dockerfile | ||
19 | |||
20 | sudo docker build -t tox-bootstrapd docker/ | ||
21 | sudo useradd --home-dir /var/lib/tox-bootstrapd --create-home --system --shell /sbin/nologin --comment "Account to run Tox's DHT bootstrap daemon" --user-group tox-bootstrapd | ||
22 | sudo chmod 700 /var/lib/tox-bootstrapd | ||
23 | sudo docker run -d --name tox-bootstrapd -v /var/lib/tox-bootstrapd/:/var/lib/tox-bootstrapd/ -p 443:443 -p 3389:3389 -p 33445:33445 -p 33445:33445/udp tox-bootstrapd | ||
24 | |||
25 | sudo ls -lbh /var/lib/tox-bootstrapd | ||
26 | |||
27 | if sudo [ ! -f /var/lib/tox-bootstrapd/keys ]; then | ||
28 | echo "Error: File /var/lib/tox-bootstrapd/keys doesn't exist" | ||
29 | exit 1 | ||
30 | fi | ||
31 | |||
32 | COUNTER=0 | ||
33 | COUNTER_END=120 | ||
34 | while [ $COUNTER -lt $COUNTER_END ]; do | ||
35 | if sudo docker logs tox-bootstrapd | grep -q "Connected to another bootstrap node successfully" ; then | ||
36 | break | ||
37 | fi | ||
38 | sleep 1 | ||
39 | COUNTER=$(($COUNTER+1)) | ||
40 | done | ||
41 | |||
42 | sudo docker logs tox-bootstrapd | ||
43 | |||
44 | if [ "$COUNTER" = "$COUNTER_END" ]; then | ||
45 | echo "Error: Didn't connect to any nodes" | ||
46 | exit 1 | ||
47 | fi | ||
48 | |||
49 | # Wait a bit befrore testing if the container is still running | ||
50 | sleep 30 | ||
51 | |||
52 | sudo docker ps -a | ||
53 | |||
54 | if [ "`sudo docker inspect -f {{.State.Running}} tox-bootstrapd`" != "true" ]; then | ||
55 | echo "Error: Container is not running" | ||
56 | exit 1 | ||
57 | fi | ||
58 | |||
59 | if ! python3 ../fun/bootstrap_node_info.py ipv4 localhost 33445 ; then | ||
60 | echo "Error: Unable to get bootstrap node info" | ||
61 | exit 1 | ||
62 | fi | ||
63 | |||
diff --git a/other/travis/toxcore-after_failure b/other/travis/toxcore-after_failure deleted file mode 100755 index e1f5c399..00000000 --- a/other/travis/toxcore-after_failure +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | if [ -d /cores ]; then | ||
4 | for core in /cores/*; do | ||
5 | lldb --core $core --one-line "bt all" < /dev/null | ||
6 | done | ||
7 | fi | ||
diff --git a/other/travis/toxcore-linux-after_script b/other/travis/toxcore-linux-after_script deleted file mode 100755 index 7a388d0d..00000000 --- a/other/travis/toxcore-linux-after_script +++ /dev/null | |||
@@ -1,8 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # We only submit coverage from the Linux build. | ||
4 | coveralls \ | ||
5 | --exclude auto_tests \ | ||
6 | --exclude other \ | ||
7 | --exclude testing \ | ||
8 | --gcov-options '\-lp' | ||
diff --git a/other/travis/toxcore-linux-install b/other/travis/toxcore-linux-install deleted file mode 100755 index 19dccf64..00000000 --- a/other/travis/toxcore-linux-install +++ /dev/null | |||
@@ -1,26 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Install cpp-coveralls to upload test coverage results. | ||
4 | pip install --user ndg-httpsclient urllib3[secure] cpp-coveralls | ||
5 | |||
6 | # Work around https://github.com/eddyxu/cpp-coveralls/issues/108 by manually | ||
7 | # installing the pyOpenSSL module and injecting it into urllib3 as per | ||
8 | # https://urllib3.readthedocs.io/en/latest/user-guide.html#ssl-py2 | ||
9 | sed -i -e '/^import sys$/a import urllib3.contrib.pyopenssl\nurllib3.contrib.pyopenssl.inject_into_urllib3()' `which coveralls` | ||
10 | |||
11 | # Install astyle (version in ubuntu-precise too old). | ||
12 | [ -f $ASTYLE ] || { | ||
13 | wget -O ../astyle.tar.gz https://deb.debian.org/debian/pool/main/a/astyle/astyle_2.06.orig.tar.gz | ||
14 | tar -xf ../astyle.tar.gz -C $CACHE_DIR | ||
15 | make -C $CACHE_DIR/astyle/build/gcc -j$NPROC | ||
16 | } | ||
17 | |||
18 | # Install libsodium (not in ubuntu-precise). | ||
19 | [ -f $CACHE_DIR/lib/libsodium.a ] || { | ||
20 | git clone --depth=1 --branch=stable https://github.com/jedisct1/libsodium ../libsodium | ||
21 | cd ../libsodium # pushd | ||
22 | ./autogen.sh | ||
23 | ./configure --prefix=$CACHE_DIR | ||
24 | make install -j$NPROC | ||
25 | cd - # popd | ||
26 | } | ||
diff --git a/other/travis/toxcore-osx-install b/other/travis/toxcore-osx-install deleted file mode 100755 index 8f13cb5f..00000000 --- a/other/travis/toxcore-osx-install +++ /dev/null | |||
@@ -1,6 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | # Workaround for bug in Homebrew where it only finds an old Ruby version. | ||
4 | brew update | ||
5 | |||
6 | brew install libsodium libvpx opus libconfig astyle | ||
diff --git a/other/travis/toxcore-windows-install b/other/travis/toxcore-windows-install deleted file mode 100755 index 6160856b..00000000 --- a/other/travis/toxcore-windows-install +++ /dev/null | |||
@@ -1,7 +0,0 @@ | |||
1 | #!/bin/sh | ||
2 | |||
3 | DOCKER_IMAGE=toktoknet/windows:latest.$ARCH-shared | ||
4 | |||
5 | docker pull $DOCKER_IMAGE | ||
6 | docker run --rm $DOCKER_IMAGE > dockcross | ||
7 | chmod +x dockcross | ||