summaryrefslogtreecommitdiff
path: root/.travis.yml
blob: 6c2b4954935e1e9487b9ad62306feca3e4b4e068 (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
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
language: cpp
os: linux

jobs:
  include:
  - addons:
      apt:
        packages:
        - g++-11
        sources:
        - ubuntu-toolchain-r-test
    arch: arm64
    compiler: g++-11
    dist: bionic
    env:
    - CC=gcc-11
    - CXX=g++-11
    - CFLAGS_EXTRA="-O3 -march=native"
    - CONF_OPTIONS="--enable-cplusplus --disable-gcj-support"
    - NO_CLONE_LIBATOMIC_OPS=true
  - addons:
      apt:
        packages:
        - g++-11
        sources:
        - ubuntu-toolchain-r-test
    arch: ppc64le
    compiler: g++-11
    dist: bionic
    env:
    - CC=gcc-11
    - CXX=g++-11
    - CFLAGS_EXTRA="-O3 -march=native"
    - CONF_OPTIONS="--enable-cplusplus --disable-gcj-support"
    - NO_CLONE_LIBATOMIC_OPS=true
  - addons:
      apt:
        packages:
        - g++-11
        sources:
        - ubuntu-toolchain-r-test
    arch: ppc64le
    compiler: g++-11
    dist: bionic
    env:
    - CC=gcc-11
    - CXX=g++-11
    - CFLAGS_EXTRA="-O3 -D NO_MPROTECT_VDB"
    - CONF_OPTIONS="--enable-cplusplus"
    - NO_CLONE_LIBATOMIC_OPS=true

before_install:
- if [[ "$CPPCHECK_ENABLE" != "" ]]; then
    CPPCHECK_VER=2.4.1;
    git clone --depth=3 https://github.com/danmar/cppcheck.git
            ~/cppcheck -b $CPPCHECK_VER;
    make --directory ~/cppcheck -j8 CXXFLAGS="-O3 -march=native -D NDEBUG";
  fi
- if [[ "$AUTOMAKE_VER" != "" || "$LIBTOOL_VER" != ""
        || "$M4_VER" != "" ]]; then
    GNUTOOLS_ROOT=`pwd`/../gnu-tools;
    export PATH=$GNUTOOLS_ROOT/bin:$PATH;
    GNU_DOWNLOAD_SITE=https://ftp.gnu.org/gnu;
  fi
- if [[ "$M4_VER" != "" ]]; then
    M4_XZ_URL=$GNU_DOWNLOAD_SITE/m4/m4-$M4_VER.tar.xz;
    wget -O - $M4_XZ_URL | tar xf - --xz --directory ~;
    (cd ~/m4-$M4_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j check && make install);
  fi
- if [[ "$LIBTOOL_VER" != "" ]]; then
    LIBTOOL_XZ_URL=$GNU_DOWNLOAD_SITE/libtool/libtool-$LIBTOOL_VER.tar.xz;
    wget -O - $LIBTOOL_XZ_URL | tar xf - --xz --directory ~;
    (cd ~/libtool-$LIBTOOL_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j && make install);
  fi
- if [[ "$AUTOMAKE_VER" != "" ]]; then
    AUTOMAKE_XZ_URL=$GNU_DOWNLOAD_SITE/automake/automake-$AUTOMAKE_VER.tar.xz;
    wget -O - $AUTOMAKE_XZ_URL | tar xf - --xz --directory ~;
    (cd ~/automake-$AUTOMAKE_VER && ./configure --prefix=$GNUTOOLS_ROOT && make -j && make install);
  fi
- if [[ "$MAKEFILE_TARGETS" == *"dist"* ]]; then
    autoconf --version;
    automake --version;
    m4 --version;
    libtool --version || true;
  fi
- if [[ "$CONF_CFLAGS" == "" ]]; then CONF_CFLAGS="-g -O2"; fi
- if [[ "$MAKEFILE_NAME" == "" ]]; then MAKEFILE_NAME=Makefile; fi
- if [[ "$MAKEFILE_TARGETS" == "" ]]; then MAKEFILE_TARGETS="check"; fi

install:
- if [[ "$NO_CLONE_LIBATOMIC_OPS" != true ]]; then
    git clone --depth=50 https://github.com/ivmai/libatomic_ops.git;
  fi
- if [[ "$CMAKE_CONFIG" == "" ]]; then
    ./autogen.sh;
  fi
- if [[ "$GNUTOOLS_ROOT" != "" ]]; then mv $GNUTOOLS_ROOT $GNUTOOLS_ROOT-x; fi
- if [[ "$REPORT_COVERAGE" == true ]]; then gem install coveralls-lcov; fi

script:
- if [[ "$CSA_CHECK" != true && "$CMAKE_CONFIG" == ""
        && "$CPPCHECK_ENABLE" == "" && "$MAKEFILE_NAME" != "Makefile.direct"
        && "$COVERITY_SCAN_BRANCH" != 1 ]]; then
    CFLAGS="$CONF_CFLAGS" ./configure $CONF_OPTIONS --enable-werror &&
    cat config.log &&
    cat include/config.h;
  fi
- if [[ "$CSA_CHECK" != true && "$CMAKE_CONFIG" == ""
        && "$CPPCHECK_ENABLE" == "" && "$COVERITY_SCAN_BRANCH" != 1 ]]; then
    make -j$MAKE_NPROC -f $MAKEFILE_NAME $MAKEFILE_TARGETS
         CFLAGS_EXTRA="$CFLAGS_EXTRA" LDFLAGS="$LDFLAGS";
  fi
- if [[ "$CMAKE_CONFIG" != "" ]]; then
    cmake $CMAKE_OPTIONS -Dbuild_tests=ON -Denable_werror=ON
          -Werror=deprecated . &&
    cmake --build . --config $CMAKE_CONFIG;
  fi
- if [[ "$CMAKE_CONFIG" != "" ]]; then
    ctest --build-config $CMAKE_CONFIG -V;
  fi
- if [[ "$CC_FOR_CHECK" != "" ]]; then
    make -f $MAKEFILE_NAME $MAKEFILE_TARGETS_CHECK CC=$CC_FOR_CHECK
            CFLAGS_EXTRA="$CFLAGS_EXTRA";
  fi
- if [ -f gctest.log ]; then cat gctest.log; fi
- if [ -f disclaim_bench.log ]; then cat disclaim_bench.log; fi
- if [ -f disclaim_test.log ]; then cat disclaim_test.log; fi
- if [ -f disclaim_weakmap_test.log ]; then cat disclaim_weakmap_test.log; fi
- if [ -f threadkey_test.log ]; then cat threadkey_test.log; fi
- if [ -f threadleaktest.log ]; then cat threadleaktest.log; fi
- if [[ "$CSA_CHECK" == true ]]; then
    ${CC} --analyze -Xanalyzer -analyzer-output=text -Werror
        -I include -I libatomic_ops/src $CFLAGS_EXTRA
        *.c *.cc cord/*.c cord/tests/cordtest.c cord/tests/de.c extra/gc.c
        extra/msvc_dbg.c extra/pcr_interface.c extra/real_malloc.c
        tests/*.c tests/*.cc tools/*.c;
  fi
- if [[ "$CPPCHECK_ENABLE" != "" ]]; then
    if [[ "$CPPCHECK_OUT_FILTER" == "" ]]; then CPPCHECK_OUT_FILTER="c "; fi;
    set -o pipefail; ~/cppcheck/cppcheck --error-exitcode=2
        -U GC_API -D CPPCHECK -I include $CPPCHECK_ENABLE |
        grep --line-buffered "$CPPCHECK_OUT_FILTER";
  fi
- if [[ "$TESTS_CUSTOM_RUN" == true ]]; then
    ASAN_OPTIONS="detect_leaks=1" UBSAN_OPTIONS="halt_on_error=1"
        make check-without-test-driver;
  fi

after_success:
- if [[ "$REPORT_COVERAGE" == true ]]; then
    lcov --capture --base-directory . --directory . --output-file coverage.info;
    lcov --remove coverage.info '/usr/*' 'cord/tests/*' 'libatomic_ops/*' 'tests/*' --output-file coverage.info;
    lcov --list coverage.info;
    coveralls-lcov --repo-token ${COVERALLS_TOKEN} coverage.info;
    bash <(curl -s https://codecov.io/bash);
  fi

deploy:
  provider: releases
  edge: true
  file: gc-*.tar.gz
  file_glob: true
  on:
    condition: $MAKEFILE_TARGETS = distcheck
    repo: ivmai/bdwgc
    tags: true