forked from ponylang/ponyc
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.travis_script.bash
113 lines (98 loc) · 5.58 KB
/
.travis_script.bash
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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
#!/bin/bash
set -o errexit
set -o nounset
# include install commands
. .travis_install.bash
# include various build commands
. .travis_commands.bash
# when running a vagrant build of ponyc
if [[ "${VAGRANT_ENV}" != "" ]]
then
set -x
case "${VAGRANT_ENV}" in
"freebsd11-x86_64")
date
docker run --rm -u pony:2000 -v $(pwd):/home/pony ponylang/ponyc-ci:cross-llvm-3.9.1-freebsd11-x86_64 make arch=x86-64 config=${config} verbose=1 CC=clang CXX=clang++ CFLAGS="-target x86_64-unknown-freebsd11.1 --sysroot=/opt/cross-freebsd-11/ -isystem /opt/cross-freebsd-11/usr/local/llvm39/include/" CXXFLAGS="-target x86_64-unknown-freebsd11.1 --sysroot=/opt/cross-freebsd-11/ -isystem /opt/cross-freebsd-11/usr/local/llvm39/include/" LDFLAGS="-target x86_64-unknown-freebsd11.1 --sysroot=/opt/cross-freebsd-11/ -isystem /opt/cross-freebsd-11/usr/local/llvm39/include/ -L/opt/cross-freebsd-11/usr/local/llvm39/lib" OSTYPE=bsd use="llvm_link_static" CROSS_SYSROOT=/opt/cross-freebsd-11 -j$(nproc)
date
download_vagrant
qemu-system-x86_64 --version
date
sudo vagrant ssh -c "cd /vagrant && ./build/${config}/ponyc --version"
sudo vagrant ssh -c "cd /vagrant && ./build/${config}/libponyc.tests"
date
sudo vagrant ssh -c "cd /vagrant && ./build/${config}/libponyrt.tests"
date
sudo vagrant ssh -c "cd /vagrant && PONYPATH=.:${PONYPATH} ./build/${config}/ponyc -d -s --checktree --verify packages/stdlib"
sudo vagrant ssh -c "cd /vagrant && ./stdlib --sequential && rm ./stdlib"
date
sudo vagrant ssh -c "cd /vagrant && PONYPATH=.:${PONYPATH} ./build/${config}/ponyc --checktree --verify packages/stdlib"
sudo vagrant ssh -c "cd /vagrant && ./stdlib --sequential && rm ./stdlib"
date
sudo vagrant ssh -c "cd /vagrant && PONYPATH=.:${PONYPATH} find examples/*/* -name '*.pony' -print | xargs -n 1 dirname | sort -u | grep -v ffi- | xargs -n 1 -I {} ./build/${config}/ponyc -d -s --checktree -o {} {}"
date
sudo vagrant ssh -c "cd /vagrant && ./build/${config}/ponyc --antlr > pony.g.new"
sudo vagrant ssh -c "cd /vagrant && diff pony.g pony.g.new"
sudo vagrant ssh -c "cd /vagrant && rm pony.g.new"
date
;;
*)
echo "ERROR: An unrecognized vagrant environment was found! VAGRANT_ENV: ${VAGRANT_ENV}"
exit 1
;;
esac
68,1 Bot
exit
fi
# setting a global python version for all subsequent executions.
# this could break the release machinery, so we might need to remove this, if it does.
# but we have this here to test stuff out on master
pyenv global 3.6
# when building debian packages for a nightly cron job or manual api requested job to make sure packaging isn't broken
if [[ "$TRAVIS_BRANCH" == "master" && "$RELEASE_DEBS" != "" && ( "$TRAVIS_EVENT_TYPE" == "cron" || "$TRAVIS_EVENT_TYPE" == "api" ) ]]
then
# verify docs build first
ponyc-build-docs
# now the packaging
"ponyc-build-debs-$RELEASE_DEBS" master
exit
fi
# when building appimage package for a nightly cron job or manual api requested job to make sure packaging isn't broken
if [[ "$TRAVIS_BRANCH" == "master" && "$RELEASE_DEBS" == "" && "$CROSS_ARCH" == "" && ( "$TRAVIS_EVENT_TYPE" == "cron" || "$TRAVIS_EVENT_TYPE" == "api" ) ]]
then
build_appimage "$(cat VERSION)"
exit
fi
# when building debian packages for a release
if [[ "$TRAVIS_BRANCH" == "release" && "$TRAVIS_PULL_REQUEST" == "false" && "$RELEASE_DEBS" != "" ]]
then
"ponyc-build-debs-$RELEASE_DEBS" "$(cat VERSION)"
fi
# when running a cross build of ponyc
if [[ "${CROSS_ARCH}" != "" ]]
then
set -x
# build and test for x86_64 first
echo "Building and testing ponyc..."
docker run --rm -u pony:2000 -v $(pwd):/home/pony "ponylang/ponyc-ci:cross-llvm-${LLVM_VERSION}-${DOCKER_ARCH}" make config=${config} CC="$CC1" CXX="$CXX1" verbose=1 -j$(nproc) all
docker run --rm -u pony:2000 -v $(pwd):/home/pony "ponylang/ponyc-ci:cross-llvm-${LLVM_VERSION}-${DOCKER_ARCH}" make config=${config} CC="$CC1" CXX="$CXX1" verbose=1 test-ci
echo "Building and testing cross ponyc..."
# build libponyrt for target arch
docker run --rm -u pony:2000 -v $(pwd):/home/pony "ponylang/ponyc-ci:cross-llvm-${LLVM_VERSION}-${DOCKER_ARCH}" make config=${config} verbose=1 CC="${CROSS_CC}" CXX="${CROSS_CXX}" arch="${CROSS_ARCH}" tune="${CROSS_TUNE}" bits="${CROSS_BITS}" CFLAGS="${CROSS_CFLAGS}" CXXFLAGS="${CROSS_CXXFLAGS}" LDFLAGS="${CROSS_LDFLAGS}" -j$(nproc) libponyrt
# build ponyc for target cross compilation
docker run --rm -u pony:2000 -v $(pwd):/home/pony "ponylang/ponyc-ci:cross-llvm-${LLVM_VERSION}-${DOCKER_ARCH}" make config=${config} verbose=1 -j$(nproc) all PONYPATH=/usr/cross/lib cross_triple="${CROSS_TRIPLE}" cross_cpu="${CROSS_TUNE}" cross_arch="${CROSS_ARCH}" cross_linker="${CROSS_LINKER}"
# run tests for cross built stdlib using ponyc cross building support
docker run --rm -u pony:2000 -v $(pwd):/home/pony "ponylang/ponyc-ci:cross-llvm-${LLVM_VERSION}-${DOCKER_ARCH}" make config=${config} verbose=1 test-cross-ci PONYPATH=/usr/cross/lib cross_triple="${CROSS_TRIPLE}" cross_cpu="${CROSS_TUNE}" cross_arch="${CROSS_ARCH}" cross_linker="${CROSS_LINKER}" QEMU_RUNNER="${QEMU_RUNNER:-}"
set +x
fi
# when RELEASE_CONFIG stops matching part of this case, move this logic
if [[ "$TRAVIS_BRANCH" == "release" && "$TRAVIS_PULL_REQUEST" == "false" && "$RELEASE_DEBS" == "" ]]
then
download_llvm
download_pcre
set_linux_compiler
build_appimage "$(cat VERSION)"
ponyc-kickoff-copr
ponyc-build-packages
ponyc-build-docs
ponyc-upload-docs
fi