forked from besser82/libxcrypt
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
187 lines (179 loc) · 7.8 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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
language: C
branches:
except:
- master
notifications:
irc:
channels:
- "ircs://chat.freenode.net:6697/#libxcrypt"
skip_join: true
sudo: true
matrix:
fast_finish: true
include:
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=all"
- FCVER="rawhide"
- CODECOV=1
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=all"
- FCVER="rawhide"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=all"
- FCVER="rawhide"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=all"
- FCVER="latest"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=all"
- FCVER="latest"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=all"
- FCVER="rawhide"
- compiler: clang
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=all"
- FCVER="rawhide"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=all"
- FCVER="latest"
- compiler: clang
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=all"
- FCVER="latest"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=strong"
- FCVER="rawhide"
- compiler: clang
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=strong"
- FCVER="rawhide"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=strong"
- FCVER="latest"
- compiler: clang
os: linux
services: docker
env:
- CONF="--disable-obsolete-api --enable-hashes=strong"
- FCVER="latest"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=glibc"
- FCVER="rawhide"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=glibc"
- FCVER="rawhide"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=glibc"
- FCVER="latest"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api --enable-hashes=glibc"
- FCVER="latest"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api=glibc --enable-hashes=strong,glibc"
- FCVER="rawhide"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api=glibc --enable-hashes=strong,glibc"
- FCVER="rawhide"
- compiler: gcc
os: linux
services: docker
env:
- CONF="--enable-obsolete-api=glibc --enable-hashes=strong,glibc"
- FCVER="latest"
- compiler: clang
os: linux
services: docker
env:
- CONF="--enable-obsolete-api=glibc --enable-hashes=strong,glibc"
- FCVER="latest"
before_install:
- for i in `seq 0 99`; do docker pull fedora:$FCVER && i= && break || sleep 1; done; [ -z "$i" ]
- perl -pe 's/\$(\w+)/$ENV{$1}/g' .travis.env.in > travis.env
- docker run -t -d -P --env-file travis.env --name buildenv -v $HOME/.ccache:/root/.ccache -v $PWD:/opt/libxcrypt fedora:$FCVER /bin/sh -c "mkdir -p /opt/libxcrypt ; bash"
- docker exec -t buildenv /bin/sh -c "echo \"deltarpm=0\" >> /etc/dnf/dnf.conf"
- docker exec -t buildenv /bin/sh -c "echo \"install_weak_deps=0\" >> /etc/dnf/dnf.conf"
- docker exec -t buildenv /bin/sh -c "echo \"max_parallel_downloads=20\" >> /etc/dnf/dnf.conf"
- docker exec -t buildenv /bin/sh -c "echo \"\" >> /etc/dnf/dnf.conf"
- if [[ "$FCVER" == "rawhide" ]] ; then docker exec -t buildenv /bin/sh -c "cat /opt/libxcrypt/.travis.dnf.conf.rawhide_latest >> /etc/dnf/dnf.conf" ; fi
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf makecache && i= && break || sleep 1; done; [ -z "$i" ]'
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best --nogpgcheck upgrade dnf gdbm fedora-gpg-keys rpm && i= && break || sleep 1; done; [ -z "$i" ]'
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf makecache && i= && break || sleep 1; done; [ -z "$i" ]'
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best upgrade && i= && break || sleep 1; done; [ -z "$i" ]'
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best groups install buildsys-build && i= && break || sleep 1; done; [ -z "$i" ]'
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best install libtool valgrind && i= && break || sleep 1; done; [ -z "$i" ]'
- if [[ "$CC" == "clang" ]] ; then docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best install clang && i= && break || sleep 1; done; [ -z "$i" ]' ; fi
- if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y --allowerasing --best install git lcov python3-pip && i= && break || sleep 1; done; [ -z "$i" ]' ; fi
- if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c "pip3 install codecov" ; fi
- docker exec -t buildenv /bin/sh -c 'for i in `seq 0 99`; do dnf -y autoremove && i= && break || sleep 1; done; [ -z "$i" ]'
before_script:
- docker exec -t buildenv /bin/sh -c "rpm -E %optflags" > cflags.txt
- docker exec -t buildenv /bin/sh -c "rpm -E %__global_ldflags" > ldflags.txt
- cat cflags.txt | tr -d '\012\015' > cflags.txt.new && mv -f cflags.txt.new cflags.txt
- cat ldflags.txt | tr -d '\012\015' > ldflags.txt.new && mv -f ldflags.txt.new ldflags.txt
- if [[ "$CC" == "clang" ]] ; then sed -i -e 's![ \t]*-fcf-protection[ \t]*! -Wno-unused-command-line-argument!g' cflags.txt ; fi
- if [[ "$FCVER" == "latest" ]] ; then sed -i -e 's![ \t]*-mcet[ \t]*! !g' cflags.txt ; fi
script:
- export CFLAGS="`cat cflags.txt`" ; export CXXFLAGS="$CFLAGS" ; echo $CFLAGS
- export LDFLAGS="`cat ldflags.txt`" ; echo $LDFLAGS
- if [[ "$CODECOV" == "1" ]] ; then export CFLAGS="-O0 -g --coverage" ; export CXXFLAGS="$CFLAGS" ; export LDFLAGS="--coverage" ; fi
- docker exec -t buildenv /bin/sh -c "cat /etc/redhat-release"
- docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && autoreconf -fiv -Wall -Werror"
- docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && CFLAGS=\"$CFLAGS\" CXXFLAGS=\"$CXXFLAGS\" LDFLAGS=\"$LDFLAGS\" ./configure --prefix=/opt/libxcrypt --disable-silent-rules --enable-shared --enable-static $CONF"
- docker exec -t buildenv /bin/sh -c "make -C /opt/libxcrypt -j$((`nproc --all` * 2))"
- docker exec -t buildenv /bin/sh -c "make -C /opt/libxcrypt install"
- docker exec -t buildenv /bin/sh -c "(make -C /opt/libxcrypt -j$((`nproc --all` * 2)) check || (cat /opt/libxcrypt/test-suite.log && exit 1))"
- docker exec -t buildenv /bin/sh -c "(make -C /opt/libxcrypt -j$((`nproc --all` * 2)) check-valgrind-memcheck || (cat /opt/libxcrypt/test-suite-memcheck.log && exit 1))"
after_success:
- if [[ "$CODECOV" == "1" ]] ; then docker exec -t buildenv /bin/sh -c "cd /opt/libxcrypt && lcov --directory . --capture --output-file all_coverage.info && lcov --remove all_coverage.info '/usr/*' '*test*' > coverage.info && rm all_coverage.info && codecov -X gcov" ; fi