summaryrefslogtreecommitdiff
path: root/ci/travis_script.sh
blob: e60e3a3c7ad1413dc226370662f80d1cc68f60df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash

set -e

msg() { echo -e "\x1b[1;32mINFO:  \x1b[37m$*\x1b[0m"; }

# TODO enable coverage
#curl -s https://codecov.io/bash > upload.sh
#chmod +x upload.sh

# We need to copy the current checkout inside the Docker container,
# because it has the MR id to be tested checked out.

msg "Generating runner:"
cat <<EOF | tee run.sh
#!/bin/bash

set -e

export CC=$CC
export CXX=$CXX
export OBJC=$CC
export OBJCXX=$CXX
export PATH=/root/tools:$PATH
if test "$MESON_RSP_THRESHOLD" != ""
then
  export MESON_RSP_THRESHOLD=$MESON_RSP_THRESHOLD
fi

source /ci/env_vars.sh
cd /root

update-alternatives --set x86_64-w64-mingw32-gcc /usr/bin/x86_64-w64-mingw32-gcc-posix
update-alternatives --set x86_64-w64-mingw32-g++ /usr/bin/x86_64-w64-mingw32-g++-posix
update-alternatives --set i686-w64-mingw32-gcc   /usr/bin/i686-w64-mingw32-gcc-posix
update-alternatives --set i686-w64-mingw32-g++   /usr/bin/i686-w64-mingw32-g++-posix

./run_tests.py $RUN_TESTS_ARGS -- $MESON_ARGS
#./upload.sh

EOF

  chmod +x run.sh

  msg "Generating Dockerfile:"
  cat <<EOF | tee Dockerfile
FROM mesonbuild/eoan
ADD . /root

EOF

msg "Building the docker image..."
docker build -t test_img .

msg "Start running tests"
#ci_env=`bash <(curl -s https://codecov.io/env)`
docker run --security-opt seccomp:unconfined test_img /root/run.sh