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