From 3af3b11c7d77250263a8c4acde19a27238724a99 Mon Sep 17 00:00:00 2001 From: Siarhei Fedartsou Date: Sun, 29 Sep 2024 11:24:12 +0200 Subject: [PATCH] Migrate to Conan 2.x --- .github/workflows/osrm-backend.yml | 93 +++++++++++++++++------------- 1 file changed, 53 insertions(+), 40 deletions(-) diff --git a/.github/workflows/osrm-backend.yml b/.github/workflows/osrm-backend.yml index d334c2ac1..519b059c4 100644 --- a/.github/workflows/osrm-backend.yml +++ b/.github/workflows/osrm-backend.yml @@ -23,36 +23,49 @@ concurrency: cancel-in-progress: true jobs: - # windows-release-node: - # needs: format-taginfo-docs - # runs-on: windows-2022 - # continue-on-error: false - # env: - # BUILD_TYPE: Release - # steps: - # - uses: actions/checkout@v4 - # - run: pip install "conan<2.0.0" - # - run: conan --version - # - run: cmake --version - # - uses: actions/setup-node@v4 - # with: - # node-version: 18 - # - run: node --version - # - run: npm --version - # - name: Prepare environment - # shell: bash - # 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 - # - run: npm install --ignore-scripts - # - run: npm link --ignore-scripts - # - name: Build - # shell: bash - # run: | - # mkdir build - # cd build - # cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON .. - # cmake --build . --config Release + windows-release-node: + needs: format-taginfo-docs + runs-on: windows-2022 + continue-on-error: false + env: + BUILD_TYPE: Release + steps: + - uses: actions/checkout@v4 + - run: pip install "conan<2.0.0" + - run: conan --version + - run: cmake --version + - uses: actions/setup-node@v4 + with: + node-version: 18 + - run: node --version + - run: npm --version + - name: Prepare environment + shell: bash + 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 + - run: npm install --ignore-scripts + - run: npm link --ignore-scripts + - name: Build + shell: bash + run: | + mkdir build + cd build + + python3 -m venv .venv + source .venv/bin/activate + + python3 -m pip install conan==2.7.1 + + conan profile detect --force + cat ~/.conan2/profiles/default + + if [[ "${ENABLE_CONAN}" == "ON" ]]; then + conan install .. --output-folder=. --build=missing --settings compiler.cppstd=20 + fi + + cmake -DCMAKE_BUILD_TYPE=Release -DENABLE_CONAN=ON -DENABLE_NODE_BINDINGS=ON -DCMAKE_TOOLCHAIN_FILE=./conan_toolchain.cmake .. + cmake --build . --config Release # # TODO: MSVC goes out of memory when building our tests # # - name: Run tests @@ -311,16 +324,16 @@ jobs: ENABLE_CONAN: ON NODE_PACKAGE_TESTS_ONLY: ON - # - name: conan-linux-debug-node - # build_node_package: true - # continue-on-error: false - # node: 20 - # runs-on: ubuntu-24.04 - # BUILD_TYPE: Debug - # CCOMPILER: clang-16 - # CXXCOMPILER: clang++-16 - # ENABLE_CONAN: ON - # NODE_PACKAGE_TESTS_ONLY: ON + - name: conan-linux-debug-node + build_node_package: true + continue-on-error: false + node: 20 + runs-on: ubuntu-24.04 + BUILD_TYPE: Debug + CCOMPILER: clang-16 + CXXCOMPILER: clang++-16 + ENABLE_CONAN: ON + NODE_PACKAGE_TESTS_ONLY: ON # - name: conan-macos-x64-release-node # build_node_package: true