language: node_js dist: bionic # enable c++11/14 builds addons: apt: sources: [ 'ubuntu-toolchain-r-test' ] packages: [ 'libstdc++-6-dev' ] install: - node -v - which node - clang++ -v - which clang++ - make ${BUILDTYPE} # Build should be standalone now, so remove mason deps - rm -rf mason_packages # *Here we run tests* # We prefer running tests in the 'before_script' section rather than 'script' to ensure fast failure. # Be aware that if you use the 'script' section it will continue running all commands in the section even if one line fails. # This is documented at https://docs.travis-ci.com/user/customizing-the-build#Breaking-the-Build # We don't want this behavior because otherwise we might risk publishing builds when the tests did not pass. # For this reason, we disable the 'script' section below, since we prefer using 'before_script'. before_script: - npm test script: # after successful tests, publish binaries if specified in commit message - ./scripts/publish.sh --toolset=${TOOLSET:-} --debug=$([ "${BUILDTYPE}" == 'debug' ] && echo "true" || echo "false") # the matrix allows you to specify different operating systems and environments to # run your tests and build binaries matrix: include: # linux cfi build - os: linux env: BUILDTYPE=release TOOLSET=cfi CXXFLAGS="-fsanitize=cfi -fvisibility=hidden" LDFLAGS="-fsanitize=cfi" # linux publishable node release - os: linux env: BUILDTYPE=release # linux publishable node debug - os: linux env: BUILDTYPE=debug # osx publishable node release - os: osx osx_image: xcode11 env: BUILDTYPE=release # osx publishable node asan - os: osx osx_image: xcode11 env: BUILDTYPE=debug TOOLSET=asan sudo: required # Linux sanitizer build - os: linux env: BUILDTYPE=debug TOOLSET=asan sudo: required # Overrides `install` to set up custom asan flags install: - make sanitize before_script: true ## ** Builds that do not get published ** # g++ build (default builds all use clang++) - os: linux env: BUILDTYPE=debug CXX="g++-6" CC="gcc-6" LINK="g++-6" AR="ar" NM="nm" CXXFLAGS="-fext-numeric-literals" addons: apt: sources: - ubuntu-toolchain-r-test packages: - libstdc++-6-dev - g++-6 # Overrides `install` to avoid initializing clang toolchain install: - make ${BUILDTYPE} # Overrides `script` to disable publishing before_script: - npm test # Overrides `script` to disable publishing script: - true # Coverage build - os: linux env: BUILDTYPE=debug CXXFLAGS="--coverage" LDFLAGS="--coverage" # Overrides `script` to publish coverage data to codecov script: - export PATH=$(pwd)/mason_packages/.link/bin/:${PATH} - which llvm-cov - pip install --user codecov - codecov --gcov-exec "llvm-cov gcov -l" # Clang format build - os: linux # can be generic since we don't need nodejs to run formatting language: generic env: CLANG_FORMAT # Overrides `install` to avoid initializing clang toolchain install: # Run the clang-format script. Any code formatting changes # will trigger the build to fail (idea here is to get us to pay attention # and get in the habit of running these locally before committing) - make format # Overrides `script`, no need to run tests before_script: - true script: - true # Clang tidy build - os: linux env: CLANG_TIDY # Overrides `install` to avoid initializing clang toolchain install: # First run the clang-tidy target # Any code formatting fixes automatically applied by clang-tidy # will trigger the build to fail (idea here is to get us to pay attention # and get in the habit of running these locally before committing) - make tidy # Overrides `script`, no need to run tests before_script: - true script: - true