From 15a910a63c2ffe83932e915216455c3f4f692d26 Mon Sep 17 00:00:00 2001 From: Michael Bell Date: Thu, 24 Jun 2021 18:59:15 +0100 Subject: [PATCH] Replace Travis with Github Actions for CI builds Replace Travis for continuous integration with Github Actions. The Github Actions pipeline is functionally equivalent, with all the same build permutations supported. Whilst the Github Actions offering is broadly equivalent to Travis, a few changes have been made as part of the migration. - The 'core' and 'optional' Travis stages have been consolidated into one build matrix. This is due to the current inability in Github Actions to share build steps between jobs, so this avoids having to duplicate the steps. Optional stage jobs will now run in parallel with core jobs, but they still remain optional in the sense that they don't fail the build. - A number of existing Github Action plugins are used to replace functionality provided by Travis or other tools: Node setup, caching, Codecov, publishing release artifacts. - Linux builds are updated to build on Ubuntu 18.04. MacOS builds are updated to run on 10.15. Similar to the Travis Xenial upgrade attempt, some changes are required due to underlying platform and compiler upgrades. This means some Node 10 toolchains will no longer be supported. Whilst there is opportunity to upgrade some dependencies and make the CI steps more idiomatic, I've left this for future changes and just focussed on functional replication. --- .github/workflows/osrm-backend.yml | 588 ++++++++++++++++++ .travis.yml | 585 ----------------- CHANGELOG.md | 4 +- CMakeLists.txt | 4 +- .../{travis => ci}/before_install.armhf.sh | 0 scripts/{travis => ci}/before_install.i686.sh | 0 .../before_install.x86_64-asan.sh | 0 scripts/{travis => ci}/is_pr_merge.sh | 0 scripts/{travis => ci}/leaksanitizer.conf | 0 scripts/{travis => ci}/node_package.sh | 0 scripts/{travis => ci}/travis_helper.sh | 0 .../maneuver_override_relation_parser.cpp | 6 - src/extractor/restriction_parser.cpp | 17 +- unit_tests/library/json.cpp | 5 +- unit_tests/library/match.cpp | 2 +- unit_tests/library/nearest.cpp | 2 +- unit_tests/library/route.cpp | 10 +- unit_tests/library/table.cpp | 4 +- unit_tests/library/trip.cpp | 2 +- 19 files changed, 613 insertions(+), 616 deletions(-) create mode 100644 .github/workflows/osrm-backend.yml delete mode 100644 .travis.yml rename scripts/{travis => ci}/before_install.armhf.sh (100%) rename scripts/{travis => ci}/before_install.i686.sh (100%) rename scripts/{travis => ci}/before_install.x86_64-asan.sh (100%) rename scripts/{travis => ci}/is_pr_merge.sh (100%) rename scripts/{travis => ci}/leaksanitizer.conf (100%) rename scripts/{travis => ci}/node_package.sh (100%) rename scripts/{travis => ci}/travis_helper.sh (100%) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml new file mode 100644 index 00000000000..3c07bc6f38f --- /dev/null +++ b/.github/workflows/osrm-backend.yml @@ -0,0 +1,588 @@ +name: osrm-backend CI +on: + push: + branches: + - master + tags: + - v[1-9]+.[0-9]+.[0-9]+ + - v[1-9]+.[0-9]+.[0-9]+-[0-9a-zA-Z]+ + - v[1-9]+.[0-9]+-[0-9a-zA-Z]+ + pull_request: + branches: + - master + +env: + CCACHE_TEMPDIR: /tmp/.ccache-temp + CCACHE_COMPRESS: 1 + CASHER_TIME_OUT: 599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742 + CCACHE_VERSION: 3.3.1 + CMAKE_VERSION: 3.7.2 + ENABLE_NODE_BINDINGS: "ON" + +jobs: + format-taginfo-docs: + runs-on: ubuntu-18.04 + steps: + - uses: actions/checkout@v2 + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: 10 + - name: Enable Node.js cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Prepare environment + run: | + npm ci --ignore-scripts + export MASON=${GITHUB_WORKSPACE}/scripts/mason.sh + ${MASON} install clang-format 10.0.0 + echo "$(${MASON} prefix clang-format 10.0.0)/bin" >> $GITHUB_PATH + - name: Run checks + run: | + ./scripts/check_taginfo.py taginfo.json profiles/car.lua + ./scripts/format.sh && ./scripts/error_on_dirty.sh + node ./scripts/validate_changelog.js + # See issue 4043 + #- npm run docs && ./scripts/error_on_dirty.sh + + build-test-publish: + needs: format-taginfo-docs + strategy: + matrix: + include: + - name: gcc-7-debug-cov + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-7 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-7 + ENABLE_COVERAGE: ON + + - name: gcc-7-debug-asan + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CCOMPILER: gcc-7 + CUCUMBER_TIMEOUT: 20000 + CXXCOMPILER: g++-7 + ENABLE_SANITIZER: ON + TARGET_ARCH: x86_64-asan + + - name: clang-5.0-debug + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + CUCUMBER_TIMEOUT: 60000 + + - name: mason-linux-debug-asan + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_MASON: ON + ENABLE_SANITIZER: ON + + - name: mason-linux-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_MASON: ON + + - name: gcc-9-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-9 + CXXCOMPILER: g++-9 + CXXFLAGS: -Wno-cast-function-type + + - name: gcc-8-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-8 + CXXCOMPILER: g++-8 + CXXFLAGS: -Wno-cast-function-type + + - name: gcc-7-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-7 + CXXCOMPILER: g++-7 + + - name: gcc-7-release-i686 + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-7 + CFLAGS: "-m32 -msse2 -mfpmath=sse" + CXXCOMPILER: g++-7 + CXXFLAGS: "-m32 -msse2 -mfpmath=sse" + TARGET_ARCH: i686 + + - name: gcc-5-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-5 + CXXCOMPILER: g++-5 + + - name: gcc-6-release + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: gcc-6 + CXXCOMPILER: g++-6 + + - name: mason-osx-release-node-10 + build_node_package: true + continue-on-error: false + node: 10 + runs-on: macos-10.15 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_MASON: ON + + - name: mason-osx-release-node-12 + build_node_package: true + continue-on-error: false + node: 12 + runs-on: macos-10.15 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_MASON: ON + + - name: mason-osx-release-node-14 + build_node_package: true + continue-on-error: false + node: 14 + runs-on: macos-10.15 + BUILD_TOOLS: ON + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_MASON: ON + + - name: gcc-7-release-shared + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TOOLS: ON + BUILD_TYPE: Release + BUILD_SHARED_LIBS: ON + CCOMPILER: gcc-7 + CXXCOMPILER: g++-7 + + - name: node-14-mason-linux-release + build_node_package: true + continue-on-error: false + node: 14 + runs-on: ubuntu-18.04 + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-14-mason-linux-debug + build_node_package: true + continue-on-error: false + node: 14 + runs-on: ubuntu-18.04 + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-12-mason-linux-release + build_node_package: true + continue-on-error: false + node: 12 + runs-on: ubuntu-18.04 + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-12-mason-linux-debug + build_node_package: true + continue-on-error: false + node: 12 + runs-on: ubuntu-18.04 + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-10-mason-linux-release + build_node_package: true + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-10-mason-linux-debug + build_node_package: true + continue-on-error: false + node: 10 + runs-on: ubuntu-18.04 + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: mason-osx-release-node-latest + build_node_package: true + continue-on-error: true + # TODO: Use node 'latest' once supported: https://github.com/actions/setup-node/issues/257 + node: 16 + runs-on: macos-10.15 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_MASON: ON + + - name: node-latest-mason-linux-release + build_node_package: true + continue-on-error: true + # TODO: Use node 'latest' once supported: https://github.com/actions/setup-node/issues/257 + node: 16 + runs-on: ubuntu-18.04 + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-latest-mason-linux-debug + build_node_package: true + continue-on-error: true + # TODO: Use node 'latest' once supported: https://github.com/actions/setup-node/issues/257 + node: 16 + runs-on: ubuntu-18.04 + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: mason-osx-release-node-lts + build_node_package: true + continue-on-error: true + node: "lts/*" + runs-on: macos-10.15 + BUILD_TYPE: Release + CCOMPILER: clang + CXXCOMPILER: clang++ + CUCUMBER_TIMEOUT: 60000 + ENABLE_ASSERTIONS: ON + ENABLE_MASON: ON + + - name: node-lts-mason-linux-release + build_node_package: true + continue-on-error: true + node: "lts/*" + runs-on: ubuntu-18.04 + BUILD_TYPE: Release + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + - name: node-lts-mason-linux-debug + build_node_package: true + continue-on-error: true + node: "lts/*" + runs-on: ubuntu-18.04 + BUILD_TYPE: Debug + CLANG_VERSION: 5.0.0 + ENABLE_GLIBC_WORKAROUND: ON + ENABLE_MASON: ON + NODE_PACKAGE_TESTS_ONLY: ON + + + name: ${{ matrix.name}} + continue-on-error: ${{ matrix.continue-on-error }} + runs-on: ${{ matrix.runs-on }} + env: + BUILD_TOOLS: ${{ matrix.BUILD_TOOLS }} + BUILD_TYPE: ${{ matrix.BUILD_TYPE }} + BUILD_SHARED_LIBS: ${{ matrix.BUILD_SHARED_LIBS }} + CCOMPILER: ${{ matrix.CCOMPILER }} + CFLAGS: ${{ matrix.CFLAGS }} + CLANG_VERSION: ${{ matrix.CLANG_VERSION }} + CUCUMBER_TIMEOUT: ${{ matrix.CUCUMBER_TIMEOUT }} + CXXCOMPILER: ${{ matrix.CXXCOMPILER }} + CXXFLAGS: ${{ matrix.CXXFLAGS }} + ENABLE_ASSERTIONS: ${{ matrix.ENABLE_ASSERTIONS }} + ENABLE_COVERAGE: ${{ matrix.ENABLE_COVERAGE }} + ENABLE_GLIBC_WORKAROUND: ${{ matrix.ENABLE_GLIBC_WORKAROUND }} + ENABLE_MASON: ${{ matrix.ENABLE_MASON }} + ENABLE_SANITIZER: ${{ matrix.ENABLE_SANITIZER }} + NODE_PACKAGE_TESTS_ONLY: ${{ matrix.NODE_PACKAGE_TESTS_ONLY }} + TARGET_ARCH: ${{ matrix.TARGET_ARCH }} + steps: + - uses: actions/checkout@v2 + + - name: Use Node.js + uses: actions/setup-node@v2 + with: + node-version: ${{ matrix.node }} + - name: Enable Node.js cache + uses: actions/cache@v2 + with: + path: ~/.npm + key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }} + restore-keys: | + ${{ runner.os }}-node- + - name: Enable compiler cache + uses: actions/cache@v2 + with: + path: ~/.ccache + key: ccache-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + ccache-${{ matrix.name }}- + - name: Enable test cache + uses: actions/cache@v2 + with: + path: ${{github.workspace}}/test/cache + key: test-${{ matrix.name }}-${{ github.sha }} + restore-keys: | + test-${{ matrix.name }}- + + - name: Prepare environment + run: | + PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") + echo PUBLISH=$([[ "${GITHUB_REF:-}" == "refs/tags/v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") >> $GITHUB_ENV + + echo "OSRM_INSTALL_DIR=${GITHUB_WORKSPACE}/install-osrm" >> $GITHUB_ENV + echo "OSRM_BUILD_DIR=${GITHUB_WORKSPACE}/build-osrm" >> $GITHUB_ENV + + if [[ "$ENABLE_SANITIZER" == 'ON' ]]; then + # We can only set this after checkout once we know the workspace directory + echo "LSAN_OPTIONS=suppressions=${GITHUB_WORKSPACE}/scripts/ci/leaksanitizer.conf" >> $GITHUB_ENV + fi + + if [[ "${RUNNER_OS}" == "Linux" ]]; then + echo "JOBS=$((`nproc` + 1))" >> $GITHUB_ENV + export MASON_OS=linux + elif [[ "${RUNNER_OS}" == "macOS" ]]; then + echo "JOBS=$((`sysctl -n hw.ncpu` + 1))" >> $GITHUB_ENV + sudo mdutil -i off / + export MASON_OS=osx + fi + + echo "MASON=${GITHUB_WORKSPACE}/scripts/mason.sh" >> $GITHUB_ENV + echo "CMAKE_URL=https://mason-binaries.s3.amazonaws.com/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" >> $GITHUB_ENV + echo "CMAKE_DIR=mason_packages/${MASON_OS}-x86_64/cmake/${CMAKE_VERSION}}" >> $GITHUB_ENV + + + - name: Install dev dependencies + run: | + # CMake + mkdir -p ${CMAKE_DIR} + wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} + echo "${CMAKE_DIR}/bin" >> $GITHUB_PATH + + # TBB + ${MASON} install tbb 2017_U7 + echo "LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH}" >> $GITHUB_ENV + + # ccache + ${MASON} install ccache ${CCACHE_VERSION} + echo "$(${MASON} prefix ccache ${CCACHE_VERSION})/bin" >> $GITHUB_PATH + + # clang + if [[ -n ${CLANG_VERSION} ]]; then + echo "CCOMPILER=clang" >> $GITHUB_ENV + echo "CXXCOMPILER=clang++" >> $GITHUB_ENV + ${MASON} install clang++ ${CLANG_VERSION} + echo "$(${MASON} prefix clang++ ${CLANG_VERSION})/bin" >> $GITHUB_PATH + # we only enable lto for release builds + # and therefore don't need to us ld.gold or llvm tools for linking + # for debug builds + if [[ ${BUILD_TYPE} == 'Release' ]]; then + ${MASON} install binutils 2.27 + echo "$(${MASON} prefix binutils 2.27)/bin" >> $GITHUB_PATH + fi + fi + + # Linux dev packages + if [ "${TARGET_ARCH}" != "i686" ] && [ "${ENABLE_MASON}" != "ON" ]; then + sudo add-apt-repository ppa:ubuntu-toolchain-r/test -y + sudo apt-get update -y + sudo apt-get install -y libbz2-dev libxml2-dev libzip-dev liblua5.2-dev libtbb-dev libboost-all-dev + if [[ -z "${CLANG_VERSION}" ]]; then + sudo apt-get install -y ${CXXCOMPILER} + fi + if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + sudo apt-get install -y lcov + fi + elif [[ $TARGET_ARCH == "i686" ]]; then + source ./scripts/ci/before_install.${TARGET_ARCH}.sh + fi + + - name: Prepare build + run: | + mkdir ${OSRM_BUILD_DIR} + ccache --max-size=256M + npm ci --ignore-scripts + if [[ "${ENABLE_COVERAGE}" == "ON" ]]; then + lcov --directory . --zerocounters # clean cached files + fi + echo "CC=${CCOMPILER}" >> $GITHUB_ENV + echo "CXX=${CXXCOMPILER}" >> $GITHUB_ENV + + - name: Build and install OSRM + run: | + echo "Using ${JOBS} jobs" + pushd ${OSRM_BUILD_DIR} + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ + -DENABLE_MASON=${ENABLE_MASON:-OFF} \ + -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF}} \ + -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ + -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ + -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ + -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ + -DBUILD_TOOLS=${BUILD_TOOLS:-OFF} \ + -DENABLE_CCACHE=ON \ + -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ + -DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF} + make --jobs=${JOBS} + + if [[ "${NODE_PACKAGE_TESTS_ONLY}" != "ON" ]]; then + make tests --jobs=${JOBS} + make benchmarks --jobs=${JOBS} + ccache -s + sudo make install + if [[ "${RUNNER_OS}" == "Linux" ]]; then + echo "LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib" >> $GITHUB_ENV + fi + echo "PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig" >> $GITHUB_ENV + fi + popd + - name: Build example + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + run: | + mkdir example/build && pushd example/build + cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} + make --jobs=${JOBS} + popd + + - name: Run all tests + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY != 'ON' }} + run: | + make -C test/data benchmark + + # macOS SIP strips the linker path. Reset this inside the running shell + export LD_LIBRARY_PATH=${{ env.LD_LIBRARY_PATH }} + ./example/build/osrm-example test/data/mld/monaco.osrm + + # All tests assume to be run from the build directory + pushd ${OSRM_BUILD_DIR} + ./unit_tests/library-tests + ./unit_tests/extractor-tests + ./unit_tests/contractor-tests + ./unit_tests/engine-tests + ./unit_tests/util-tests + ./unit_tests/server-tests + ./unit_tests/partitioner-tests + ./unit_tests/customizer-tests + if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then + npm run nodejs-tests + fi + popd + npm test + - name: Run Node package tests only + if: ${{ matrix.NODE_PACKAGE_TESTS_ONLY == 'ON' }} + run: | + npm run nodejs-tests + + - name: Generate code coverage + if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + run: | + lcov --directory . --capture --output-file coverage.info # capture coverage info + lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system + lcov --list coverage.info #debug info + # Uploading report to CodeCov + - name: Upload code coverage + if: ${{ matrix.ENABLE_COVERAGE == 'ON' }} + uses: codecov/codecov-action@v1 + with: + files: coverage.info + name: codecov-osrm-backend + fail_ci_if_error: true + verbose: true + + - name: Build Node package + if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} + run: ./scripts/ci/node_package.sh + - name: Publish Node package + if: ${{ matrix.build_node_package && env.PUBLISH == 'On' }} + uses: ncipollo/release-action@v1 + with: + allowUpdates: true + artifactErrorsFailBuild: true + artifacts: build/stage/**/*.tar.gz + omitBody: true + omitBodyDuringUpdate: true + omitName: true + omitNameDuringUpdate: true + replacesArtifacts: true + token: ${{ secrets.GITHUB_TOKEN }} + + action-complete: + runs-on: ubuntu-18.04 + needs: build-test-publish + steps: + - run: echo "Action complete" diff --git a/.travis.yml b/.travis.yml deleted file mode 100644 index 33cbdeeba6c..00000000000 --- a/.travis.yml +++ /dev/null @@ -1,585 +0,0 @@ -language: cpp - -git: - depth: 10 - -# sudo:required is needed for trusty images -sudo: required -dist: trusty - -notifications: - email: false - -branches: - only: - - master - # enable building tags - - /^v\d+\.\d+(\.\d+)?(-\S*)?$/ - -cache: - npm: true - ccache: true - apt: true - directories: - - test/cache - -env: - global: - - CCACHE_TEMPDIR=/tmp/.ccache-temp - - CCACHE_COMPRESS=1 - - CASHER_TIME_OUT=599 # one second less than 10m to avoid 10m timeout error: https://github.com/Project-OSRM/osrm-backend/issues/2742 - - CCACHE_VERSION=3.3.1 - - CMAKE_VERSION=3.7.2 - - MASON="$(pwd)/scripts/mason.sh" - - ENABLE_NODE_BINDINGS=On - - NODE="10" - -stages: - - core - - optional - -matrix: - fast_finish: true - - # We override the compiler names here to yield better ccache behavior, which uses this as key - include: - - # Debug Builds - - stage: core - os: linux - compiler: "format-taginfo-docs" - env: NODE=10 - sudo: false - before_install: - install: - - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash - - source $NVM_DIR/nvm.sh - - nvm install $NODE - - nvm use $NODE - - npm --version - - npm ci --ignore-scripts - script: - - ./scripts/check_taginfo.py taginfo.json profiles/car.lua - - ${MASON} install clang-format 10.0.0 - - PATH=$(${MASON} prefix clang-format 10.0.0)/bin:${PATH} ./scripts/format.sh && ./scripts/error_on_dirty.sh - - node ./scripts/validate_changelog.js - # See issue 4043 - #- npm run docs && ./scripts/error_on_dirty.sh - after_success: - - - os: linux - compiler: "gcc-7-debug-cov" - addons: &gcc7 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'lcov'] - env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' ENABLE_COVERAGE=ON CUCUMBER_TIMEOUT=20000 - before_script: - - cd ${TRAVIS_BUILD_DIR} - - lcov --directory . --zerocounters # clean cached da files - after_success: - # Creating report - - cd ${TRAVIS_BUILD_DIR} - - lcov --directory . --capture --output-file coverage.info # capture coverage info - - lcov --remove coverage.info '/usr/*' --output-file coverage.info # filter out system - - lcov --list coverage.info #debug info - # Uploading report to CodeCov - - bash <(curl -s https://codecov.io/bash) || echo "Codecov did not collect coverage reports" - - - os: linux - compiler: "gcc-7-debug-asan" - addons: &gcc7 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Debug' TARGET_ARCH='x86_64-asan' ENABLE_SANITIZER=ON CUCUMBER_TIMEOUT=20000 LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf" - - - os: linux - compiler: "clang-5.0-debug" - addons: &clang50 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-5-dev', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' CUCUMBER_TIMEOUT=60000 - - - os: linux - compiler: "mason-linux-debug-asan" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_SANITIZER=ON LSAN_OPTIONS="suppressions=$TRAVIS_BUILD_DIR/scripts/travis/leaksanitizer.conf" - - # Release Builds - - os: linux - compiler: "mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON RUN_CLANG_FORMAT=ON ENABLE_LTO=ON - - - os: linux - compiler: "gcc-9-release" - addons: &gcc9 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-9', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CCOMPILER='gcc-9' CXXCOMPILER='g++-9' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type' - - - os: linux - compiler: "gcc-8-release" - addons: &gcc8 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-8', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CCOMPILER='gcc-8' CXXCOMPILER='g++-8' BUILD_TYPE='Release' CXXFLAGS='-Wno-cast-function-type' - - - os: linux - compiler: "gcc-7-release" - addons: &gcc7 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' - - - os: linux - compiler: "gcc-7-release-i686" - env: > - TARGET_ARCH='i686' CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' - CFLAGS='-m32 -msse2 -mfpmath=sse' CXXFLAGS='-m32 -msse2 -mfpmath=sse' - - - os: linux - compiler: "gcc-5-release" - addons: &gcc49 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-5', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache'] - env: CCOMPILER='gcc-5' CXXCOMPILER='g++-5' BUILD_TYPE='Release' - - - os: linux - compiler: "gcc-6-release" - addons: &gcc49 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-6', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev', 'ccache'] - env: CCOMPILER='gcc-6' CXXCOMPILER='g++-6' BUILD_TYPE='Release' - - - os: osx - osx_image: xcode9.2 - compiler: "mason-osx-release-node-10" - # we use the xcode provides clang and don't install our own - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="10" - after_success: - - ./scripts/travis/node_package.sh - - - os: osx - osx_image: xcode9.2 - compiler: "mason-osx-release-node-12" - # we use the xcode provides clang and don't install our own - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="12" - after_success: - - ./scripts/travis/node_package.sh - - - os: osx - osx_image: xcode9.2 - compiler: "mason-osx-release-node-14" - # we use the xcode provides clang and don't install our own - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="14" - after_success: - - ./scripts/travis/node_package.sh - - # Shared Library - - os: linux - compiler: "gcc-7-release-shared" - addons: &gcc7 - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['g++-7', 'libbz2-dev', 'libxml2-dev', 'libzip-dev', 'liblua5.2-dev', 'libtbb-dev', 'libboost-all-dev'] - env: CCOMPILER='gcc-7' CXXCOMPILER='g++-7' BUILD_TYPE='Release' BUILD_SHARED_LIBS=ON - - # Node build jobs. These skip running the tests. - - os: linux - sudo: false - compiler: "node-14-mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="14" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-14-mason-linux-debug" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="14" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-12-mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="12" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-12-mason-linux-debug" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="12" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-10-mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="10" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-10-mason-linux-debug" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="10" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: osx - stage: optional - osx_image: xcode9.2 - compiler: "mason-osx-release-node-latest" - # we use the xcode provides clang and don't install our own - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node" - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-latest-mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-latest-mason-linux-debug" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: osx - osx_image: xcode9.2 - compiler: "mason-osx-release-node-lts" - # we use the xcode provides clang and don't install our own - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts" - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-lts-mason-linux-release" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - - os: linux - sudo: false - compiler: "node-lts-mason-linux-debug" - addons: - apt: - sources: ['ubuntu-toolchain-r-test'] - packages: ['libstdc++-4.9-dev'] - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts" - install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=ON - - make --jobs=${JOBS} - - popd - script: - - npm run nodejs-tests - after_success: - - ./scripts/travis/node_package.sh - - allow_failures: - - compiler: "mason-osx-release-node-latest" - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="node" - - compiler: "node-latest-mason-linux-release" - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node" - - compiler: "node-latest-mason-linux-debug" - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="node" - - compiler: "mason-osx-release-node-lts" - env: ENABLE_MASON=ON BUILD_TYPE='Release' CUCUMBER_TIMEOUT=60000 CCOMPILER='clang' CXXCOMPILER='clang++' ENABLE_ASSERTIONS=ON ENABLE_LTO=ON NODE="--lts" - - compiler: "node-lts-mason-linux-release" - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Release' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts" - - compiler: "node-lts-mason-linux-debug" - env: CLANG_VERSION='5.0.0' BUILD_TYPE='Debug' ENABLE_MASON=ON ENABLE_LTO=ON JOBS=3 NODE="--lts" - -before_install: - - curl -o- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash - - source $NVM_DIR/nvm.sh - - nvm install $NODE - - nvm use $NODE - - node --version - - if [[ ! -z $TARGET_ARCH ]] ; then source ./scripts/travis/before_install.$TARGET_ARCH.sh ; fi - - | - if [[ -z $JOBS ]]; then - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then - export JOBS=$((`nproc` + 1)) - elif [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - export JOBS=$((`sysctl -n hw.ncpu` + 1)) - fi - fi - - | - if [[ "${TRAVIS_OS_NAME}" == "osx" ]]; then - sudo mdutil -i off / - fi - - export PACKAGE_JSON_VERSION=$(node -e "console.log(require('./package.json').version)") - - export PUBLISH=$([[ "${TRAVIS_TAG:-}" == "v${PACKAGE_JSON_VERSION}" ]] && echo "On" || echo "Off") - - echo "Using ${JOBS} jobs" - - npm ci --ignore-scripts - # Bootstrap cmake to be able to run mason - - CMAKE_URL="https://mason-binaries.s3.amazonaws.com/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}.tar.gz" - - CMAKE_DIR="mason_packages/${TRAVIS_OS_NAME}-x86_64/cmake/${CMAKE_VERSION}" - - mkdir -p ${CMAKE_DIR} - - travis_retry wget --quiet -O - ${CMAKE_URL} | tar --strip-components=1 -xz -C ${CMAKE_DIR} || travis_terminate 1 - - export PATH=${CMAKE_DIR}/bin:${PATH} - - ${MASON} install tbb 2017_U7 && export LD_LIBRARY_PATH=$(${MASON} prefix tbb 2017_U7)/lib/:${LD_LIBRARY_PATH} - - ${MASON} install ccache ${CCACHE_VERSION} && export PATH=$(${MASON} prefix ccache ${CCACHE_VERSION})/bin:${PATH} - - | - if [[ ! -z ${CLANG_VERSION} ]]; then - export CCOMPILER='clang' - export CXXCOMPILER='clang++' - ${MASON} install clang++ ${CLANG_VERSION} && export PATH=$(${MASON} prefix clang++ ${CLANG_VERSION})/bin:${PATH} || travis_terminate 1 - # we only enable lto for release builds - # and therefore don't need to us ld.gold or llvm tools for linking - # for debug builds - if [[ ${BUILD_TYPE} == 'Release' ]]; then - ${MASON} install binutils 2.27 && export PATH=$(${MASON} prefix binutils 2.27)/bin:${PATH} || travis_terminate 1 - fi - fi - - ccache --max-size=256M # limiting the cache's size to roughly the previous job's object sizes - - export OSRM_INSTALL_DIR="$(pwd)/install-osrm" - - export OSRM_BUILD_DIR="$(pwd)/build-osrm" - - export CC=${CCOMPILER} CXX=${CXXCOMPILER} - - mkdir ${OSRM_BUILD_DIR} - -install: - - pushd ${OSRM_BUILD_DIR} - - | - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} \ - -DENABLE_MASON=${ENABLE_MASON:-OFF} \ - -DENABLE_ASSERTIONS=${ENABLE_ASSERTIONS:-OFF} \ - -DBUILD_SHARED_LIBS=${BUILD_SHARED_LIBS:-OFF} \ - -DENABLE_COVERAGE=${ENABLE_COVERAGE:-OFF} \ - -DENABLE_NODE_BINDINGS=${ENABLE_NODE_BINDINGS:-OFF} \ - -DENABLE_SANITIZER=${ENABLE_SANITIZER:-OFF} \ - -DBUILD_TOOLS=ON \ - -DENABLE_CCACHE=ON \ - -DCMAKE_INSTALL_PREFIX=${OSRM_INSTALL_DIR} \ - -DENABLE_GLIBC_WORKAROUND=${ENABLE_GLIBC_WORKAROUND:-OFF} - - echo "travis_fold:start:MAKE" - - make --jobs=${JOBS} - - make tests --jobs=${JOBS} - - make benchmarks --jobs=${JOBS} - - echo "travis_fold:end:MAKE" - - ccache -s - - sudo make install - - | - if [[ "${TRAVIS_OS_NAME}" == "linux" ]]; then - export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:${OSRM_INSTALL_DIR}/lib - fi - - popd - - mkdir example/build && pushd example/build - - export PKG_CONFIG_PATH=${OSRM_INSTALL_DIR}/lib/pkgconfig - - cmake .. -DCMAKE_BUILD_TYPE=${BUILD_TYPE} - - make --jobs=${JOBS} - - popd - -script: - - if [[ $TARGET_ARCH == armhf ]] ; then echo "Skip tests for $TARGET_ARCH" && exit 0 ; fi - - make -C test/data benchmark - - ./example/build/osrm-example test/data/mld/monaco.osrm - # All tests assume to be run from the build directory - - pushd ${OSRM_BUILD_DIR} - - ./unit_tests/library-tests - - ./unit_tests/extractor-tests - - ./unit_tests/contractor-tests - - ./unit_tests/engine-tests - - ./unit_tests/util-tests - - ./unit_tests/server-tests - - ./unit_tests/partitioner-tests - - ./unit_tests/customizer-tests - - | - if [ -z "${ENABLE_SANITIZER}" ] && [ "$TARGET_ARCH" != "i686" ]; then - npm run nodejs-tests - fi - - | - - popd - - npm test - -deploy: - provider: releases - api_key: - secure: "Ej7tPd+XhAlBvA0SnYghYakO6QUwUI+oOtjlkPmy0UfKtIQ4bIzoIm1BDbPwrmNiCSKB7lLZYZpKz68PBRtblfqvTjhzXSzlvFk36pyywgkuNY13N3VQZo2c5CShLCy41nx4+uLkjhLfKYOALSE3OivdJJHLZEsSwx60Csx7owU=" - skip_cleanup: true - file_glob: true - file: build/stage/**/*.tar.gz - on: - tags: true - condition: "$PUBLISH = 'On'" diff --git a/CHANGELOG.md b/CHANGELOG.md index bfa3c5dd568..9576e197fe2 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased - + - Changes from 5.25.0 + - Build: + - CHANGED: Replace Travis with Github Actions for CI builds [#6071](https://github.com/Project-OSRM/osrm-backend/pull/6071) # 5.25.0 - Changes from 5.24.0 - Build: diff --git a/CMakeLists.txt b/CMakeLists.txt index e6feb6de9aa..265d27d64c3 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -514,7 +514,7 @@ if(ENABLE_MASON) set(CMAKE_MODULE_LINKER_FLAGS "${CMAKE_MODULE_LINKER_FLAGS} ${LINKER_FLAGS}") # current mason packages target -D_GLIBCXX_USE_CXX11_ABI=0 - set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -D_GLIBCXX_USE_CXX11_ABI=0") + add_dependency_defines(-D_GLIBCXX_USE_CXX11_ABI=0) # note: we avoid calling find_package(Osmium ...) here to ensure that the # expat and bzip2 are used from mason rather than the system @@ -862,4 +862,4 @@ if (ENABLE_NODE_BINDINGS) endforeach() add_library(check-headers STATIC EXCLUDE_FROM_ALL ${sources}) set_target_properties(check-headers PROPERTIES ARCHIVE_OUTPUT_DIRECTORY ${check_headers_dir}) -endif() \ No newline at end of file +endif() diff --git a/scripts/travis/before_install.armhf.sh b/scripts/ci/before_install.armhf.sh similarity index 100% rename from scripts/travis/before_install.armhf.sh rename to scripts/ci/before_install.armhf.sh diff --git a/scripts/travis/before_install.i686.sh b/scripts/ci/before_install.i686.sh similarity index 100% rename from scripts/travis/before_install.i686.sh rename to scripts/ci/before_install.i686.sh diff --git a/scripts/travis/before_install.x86_64-asan.sh b/scripts/ci/before_install.x86_64-asan.sh similarity index 100% rename from scripts/travis/before_install.x86_64-asan.sh rename to scripts/ci/before_install.x86_64-asan.sh diff --git a/scripts/travis/is_pr_merge.sh b/scripts/ci/is_pr_merge.sh similarity index 100% rename from scripts/travis/is_pr_merge.sh rename to scripts/ci/is_pr_merge.sh diff --git a/scripts/travis/leaksanitizer.conf b/scripts/ci/leaksanitizer.conf similarity index 100% rename from scripts/travis/leaksanitizer.conf rename to scripts/ci/leaksanitizer.conf diff --git a/scripts/travis/node_package.sh b/scripts/ci/node_package.sh similarity index 100% rename from scripts/travis/node_package.sh rename to scripts/ci/node_package.sh diff --git a/scripts/travis/travis_helper.sh b/scripts/ci/travis_helper.sh similarity index 100% rename from scripts/travis/travis_helper.sh rename to scripts/ci/travis_helper.sh diff --git a/src/extractor/maneuver_override_relation_parser.cpp b/src/extractor/maneuver_override_relation_parser.cpp index a414c0150cf..5a48adfb4d4 100644 --- a/src/extractor/maneuver_override_relation_parser.cpp +++ b/src/extractor/maneuver_override_relation_parser.cpp @@ -1,14 +1,8 @@ #include "extractor/maneuver_override_relation_parser.hpp" #include "extractor/maneuver_override.hpp" -#include "util/log.hpp" - -#include -#include -#include #include #include -#include #include #include diff --git a/src/extractor/restriction_parser.cpp b/src/extractor/restriction_parser.cpp index 28ff24a57db..c81f4331d4f 100644 --- a/src/extractor/restriction_parser.cpp +++ b/src/extractor/restriction_parser.cpp @@ -5,10 +5,8 @@ #include "util/log.hpp" #include -#include #include #include -#include #include #include @@ -244,14 +242,15 @@ bool RestrictionParser::ShouldIgnoreRestriction(const std::string &except_tag_st // Be warned, this is quadratic work here, but we assume that // only a few exceptions are actually defined. - std::vector exceptions; - boost::algorithm::split_regex(exceptions, except_tag_string, boost::regex("[;][ ]*")); + const std::regex delimiter_re("[;][ ]*"); + std::sregex_token_iterator except_tags_begin( + except_tag_string.begin(), except_tag_string.end(), delimiter_re, -1); + std::sregex_token_iterator except_tags_end; - return std::any_of( - std::begin(exceptions), std::end(exceptions), [&](const std::string ¤t_string) { - return std::end(restrictions) != - std::find(std::begin(restrictions), std::end(restrictions), current_string); - }); + return std::any_of(except_tags_begin, except_tags_end, [&](const std::string ¤t_string) { + return std::end(restrictions) != + std::find(std::begin(restrictions), std::end(restrictions), current_string); + }); } } // namespace extractor } // namespace osrm diff --git a/unit_tests/library/json.cpp b/unit_tests/library/json.cpp index 537eecc940c..1b0b36a86e4 100644 --- a/unit_tests/library/json.cpp +++ b/unit_tests/library/json.cpp @@ -6,7 +6,6 @@ #include "engine/api/json_factory.hpp" #include "osrm/coordinate.hpp" -#include #include using namespace osrm; @@ -27,7 +26,7 @@ BOOST_AUTO_TEST_CASE(test_json_linestring) const auto coords = geom.values["coordinates"].get().values; BOOST_CHECK_EQUAL(coords.size(), 3); // array of three location arrays - for (const auto each : coords) + for (const auto &each : coords) { const auto loc = each.get().values; BOOST_CHECK_EQUAL(loc.size(), 2); @@ -53,7 +52,7 @@ BOOST_AUTO_TEST_CASE(test_json_single_point) const auto coords = geom.values["coordinates"].get().values; BOOST_CHECK_EQUAL(coords.size(), 2); // array of two location arrays - for (const auto each : coords) + for (const auto &each : coords) { const auto loc = each.get().values; BOOST_CHECK_EQUAL(loc.size(), 2); diff --git a/unit_tests/library/match.cpp b/unit_tests/library/match.cpp index 2302012c748..70be34472d0 100644 --- a/unit_tests/library/match.cpp +++ b/unit_tests/library/match.cpp @@ -184,7 +184,7 @@ BOOST_AUTO_TEST_CASE(test_match_fb_serialization) const auto matchings = fb->routes(); const auto &number_of_matchings = matchings->size(); - for (const auto &waypoint : *waypoints) + for (const auto waypoint : *waypoints) { BOOST_CHECK(waypoint_check(waypoint)); const auto matchings_index = waypoint->matchings_index(); diff --git a/unit_tests/library/nearest.cpp b/unit_tests/library/nearest.cpp index 5ad451445ca..249e19387f5 100644 --- a/unit_tests/library/nearest.cpp +++ b/unit_tests/library/nearest.cpp @@ -202,7 +202,7 @@ BOOST_AUTO_TEST_CASE(test_nearest_fb_serialization) auto waypoints = fb->waypoints(); BOOST_CHECK(waypoints->size() > 0); // the dataset has at least one nearest coordinate - for (const auto &waypoint : *waypoints) + for (const auto waypoint : *waypoints) { BOOST_CHECK(waypoint->distance() >= 0); BOOST_CHECK(waypoint->nodes()->first() != 0); diff --git a/unit_tests/library/route.cpp b/unit_tests/library/route.cpp index 44fcb877b6f..0e4798523ad 100644 --- a/unit_tests/library/route.cpp +++ b/unit_tests/library/route.cpp @@ -263,7 +263,7 @@ void test_route_same_coordinates(bool use_json_only_api) const auto &entries = intersection_object.at("entry").get().values; BOOST_CHECK(bearings.size() == entries.size()); - for (const auto bearing : bearings) + for (const auto &bearing : bearings) BOOST_CHECK(0. <= bearing.get().value && bearing.get().value <= 360.); @@ -619,7 +619,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb) const auto waypoints = fb->waypoints(); BOOST_CHECK(waypoints->size() == params.coordinates.size()); - for (const auto &waypoint : *waypoints) + for (const auto waypoint : *waypoints) { const auto longitude = waypoint->location()->longitude(); const auto latitude = waypoint->location()->latitude(); @@ -633,7 +633,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb) const auto routes = fb->routes(); BOOST_REQUIRE_GT(routes->size(), 0); - for (const auto &route : *routes) + for (const auto route : *routes) { BOOST_CHECK_EQUAL(route->distance(), 0); BOOST_CHECK_EQUAL(route->duration(), 0); @@ -641,7 +641,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb) const auto &legs = route->legs(); BOOST_CHECK(legs->size() > 0); - for (const auto &leg : *legs) + for (const auto leg : *legs) { BOOST_CHECK_EQUAL(leg->distance(), 0); @@ -720,7 +720,7 @@ BOOST_AUTO_TEST_CASE(test_route_serialize_fb_skip_waypoints) const auto routes = fb->routes(); BOOST_REQUIRE_GT(routes->size(), 0); - for (const auto &route : *routes) + for (const auto route : *routes) { BOOST_CHECK_EQUAL(route->distance(), 0); BOOST_CHECK_EQUAL(route->duration(), 0); diff --git a/unit_tests/library/table.cpp b/unit_tests/library/table.cpp index 74801f2c707..0fa27d9a1cf 100644 --- a/unit_tests/library/table.cpp +++ b/unit_tests/library/table.cpp @@ -332,14 +332,14 @@ BOOST_AUTO_TEST_CASE(test_table_serialiaze_fb) // check destinations array of waypoint objects const auto &destinations_array = fb->table()->destinations(); BOOST_CHECK_EQUAL(destinations_array->size(), params.destinations.size()); - for (const auto &destination : *destinations_array) + for (const auto destination : *destinations_array) { BOOST_CHECK(waypoint_check(destination)); } // check sources array of waypoint objects const auto &sources_array = fb->waypoints(); BOOST_CHECK_EQUAL(sources_array->size(), params.sources.size()); - for (const auto &source : *sources_array) + for (const auto source : *sources_array) { BOOST_CHECK(waypoint_check(source)); } diff --git a/unit_tests/library/trip.cpp b/unit_tests/library/trip.cpp index ba80cf542f8..6eb500e8160 100644 --- a/unit_tests/library/trip.cpp +++ b/unit_tests/library/trip.cpp @@ -525,7 +525,7 @@ BOOST_AUTO_TEST_CASE(test_roundtrip_response_fb_serialization) const auto trips = fb->routes(); BOOST_CHECK_EQUAL(trips->size(), 1); - for (const auto &waypoint : *waypoints) + for (const auto waypoint : *waypoints) { const auto longitude = waypoint->location()->longitude(); const auto latitude = waypoint->location()->latitude();