summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: f6c634d803fabb727b281a78924ab6e62853d1ef (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
sudo: required

language: c

env:
  - BUILD_OPTS="--prefix=/usr --libdir=/usr/lib64"
  - BUILD_OPTS="--prefix=/usr --libdir=/usr/lib64 CFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE' LDFLAGS='-fsanitize=address -g -fno-common -U_FORTIFY_SOURCE' LIBS='-ldl -lpthread'"
  - BUILD_OPTS="--prefix=/usr --libdir=/usr/lib64 CFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE' CXXFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE' LDFLAGS='-fsanitize=undefined -g -fno-common -U_FORTIFY_SOURCE' LIBS='-ldl -lpthread'"
  - BUILD_OPTS="--prefix=/usr --libdir=/usr/lib64" SCAN_BUILD="scan-build --status-bugs"
  - BUILD_OPTS="-host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 --without-libffi" TESTS_ENVIRONMENT="wine"

matrix:
  allow_failures:
    - env: BUILD_OPTS="-host=x86_64-w64-mingw32 --prefix=/usr/x86_64-w64-mingw32 --without-libffi" TESTS_ENVIRONMENT="wine"

services:
  - docker

before_install:
  - docker pull fedora
  - export CONTAINER=$(docker run -d fedora sleep 1800)
  - docker exec $CONTAINER dnf -y install 'dnf-command(builddep)'
  - docker exec $CONTAINER dnf -y builddep p11-kit
  - docker exec $CONTAINER dnf -y install gettext-devel libtool make
  - docker exec $CONTAINER dnf -y install libasan libubsan
  - docker exec $CONTAINER dnf -y install clang-analyzer
  - docker exec $CONTAINER dnf -y install mingw64-gcc mingw64-libffi mingw64-libtasn1 wine
  - docker exec $CONTAINER useradd user
  - docker exec $CONTAINER mkdir /builddir
  - docker exec $CONTAINER chown -R user /builddir

install:
  - docker cp . $CONTAINER:/srcdir
  # FIXME: This is needed because some files are included in distribution
  # and need to be generated in $srcdir rather than $builddir
  - docker exec $CONTAINER chown -R user /srcdir

script:
  - docker exec $CONTAINER sh -c "cd /srcdir && NOCONFIGURE=1 ./autogen.sh"
  - docker exec $CONTAINER su - user sh -c "cd /builddir && ../srcdir/configure --enable-strict $BUILD_OPTS"
  - docker exec $CONTAINER su - user sh -c "cd /builddir && $SCAN_BUILD make V=1 && make check V=1 TESTS_ENVIRONMENT=\"$TESTS_ENVIRONMENT\""