-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy path.travis.yml
107 lines (99 loc) · 3.27 KB
/
.travis.yml
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
language: c
sudo: required
cache:
directories:
- nim
- upx
- pcre
- openssl
- libressl
env:
global:
- NIMFILE="hello.nim"
- BINFILE="./hello"
#
- NIMREPO="https://github.com/nim-lang/Nim"
- NIMVER="$(git ls-remote ${NIMREPO} devel | cut -f 1)"
- NIMDIR="${TRAVIS_BUILD_DIR}/nim/${NIMVER}"
- UPXVER="3.95" # Change this value when upgrading upx
- PCREVER="8.42" # Change this value when upgrading pcre
- LIBRESSLVER="2.8.1" # Change this value when upgrading libressl
- OPENSSLVER="1.1.1" # Change this value when upgrading openssl
addons:
apt:
packages:
# For building MUSL static builds on Linux.
- musl-tools
install:
- set -e # Quit on first error
- echo "NIMDIR = ${NIMDIR}"
- |
if [[ ! -f "${NIMDIR}/bin/nim" ]]
then
rm -rf nim
mkdir -p nim
git clone --single-branch --branch devel --depth=1 "${NIMREPO}" "${NIMDIR}"
cd "${NIMDIR}" || exit
# Don't build 'koch tools'; remove that line from build_all.sh.
sed -i '/koch tools/d' build_all.sh
sh build_all.sh # https://github.com/nim-lang/Nim/issues/17907#issuecomment-831654235
fi
- export PATH="${NIMDIR}/bin:${PATH}"
- nim -v
- |
if [[ ! -f "${TRAVIS_BUILD_DIR}/upx/${UPXVER}/upx" ]]
then
echo "Installing upx .."
# Ensure that you are in repo/build root now.
cd "${TRAVIS_BUILD_DIR}"
curl -OL "https://github.com/upx/upx/releases/download/v${UPXVER}/upx-${UPXVER}-amd64_linux.tar.xz"
tar xvf "upx-${UPXVER}-amd64_linux.tar.xz"
mkdir -p upx
mv "upx-${UPXVER}-amd64_linux" "upx/${UPXVER}"
fi
- export PATH="${TRAVIS_BUILD_DIR}/upx/${UPXVER}/:${PATH}"
- upx --version | grep -E '^upx'
script:
# Ensure that you are in repo/build root now.
- cd "${TRAVIS_BUILD_DIR}"
- echo 'echo "Hello, World!"' > "${NIMFILE}"
# Fri Aug 30 09:18:18 EDT 2019 - kmodi
# Remove the lint check for config.nims; this broke in this range of commits on Nim devel:
# https://github.com/nim-lang/Nim/compare/a25d43ca6b5b9a918a7e...170cb4f4cbe734d6fa30
# As per Araq (https://gitter.im/nim-lang/Nim?at=5d69220e7b263a4c9c7f6042), this was expected.
# # Lint check
# - nim check --styleCheck:hint config.nims
# strip, upx
- nim c "${NIMFILE}"
- nim strip "${BINFILE}"
- nim upx "${BINFILE}"
- "${BINFILE}"
# checksums
- nim checksums "${BINFILE}"
# musl
- nim musl "${NIMFILE}"
- file "${BINFILE}"
- "${BINFILE}"
# musl -d:pcre
- nim musl -d:pcre "${NIMFILE}"
- file "${BINFILE}"
- "${BINFILE}"
# musl -d:libressl
- nim musl -d:libressl "${NIMFILE}"
- file "${BINFILE}"
- "${BINFILE}"
# musl -d:openssl
- nim musl -d:openssl "${NIMFILE}"
- file "${BINFILE}"
- "${BINFILE}"
notifications:
email:
on_success: never # default: change
on_failure: always # default: always
# References:
# choosenim: https://github.com/mratsim/Arraymancer/blob/master/.travis.yml
# musl: https://github.com/BurntSushi/ripgrep/blob/master/.travis.yml
# nim build caching: https://github.com/status-im/nimbus/blob/master/.travis.yml
# https://docs.travis-ci.com/user/deployment/releases/
# https://github.com/nim-lang/Nim/wiki/TravisCI
# https://docs.travis-ci.com/user/environment-variables/#default-environment-variables