From 193182887cf648f4aa2b420f8c833acf661e332d Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Tue, 3 Jun 2025 17:37:53 +0300 Subject: [PATCH 1/2] Add github action ci with vcpkg --- .github/workflows/build.yml | 67 +++++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .github/workflows/build.yml diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..61c1316f --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,67 @@ +name: Build & Test + +on: + pull_request: + push: + branches: + - main + +concurrency: + group: ${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +jobs: + default: + name: ${{ matrix.os }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + include: + - os: windows-latest + triplet: x64-windows-release + build_type: Release + steps: + - uses: actions/checkout@v4 + with: + submodules: true + + - name: "Install dependencies" + run: > + vcpkg x-set-installed --triplet ${{ matrix.triplet }} + assimp + boost-dynamic-bitset + boost-filesystem + boost-graph + boost-odeint + boost-program-options + boost-serialization + boost-system + boost-test + boost-ublas + eigen3 + fcl + pkgconf + + - name: cmake generate + shell: bash + run: > + cmake -B build + -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake + -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DOMPL_VERSIONED_INSTALL=OFF + -DOMPL_BUILD_DEMOS=OFF + -DOMPL_BUILD_PYBINDINGS=OFF + -DCMAKE_POLICY_DEFAULT_CMP0167=OLD + -DOMPL_REGISTRATION=OFF + + - name: cmake build + shell: bash + run: | + cmake --build build --config ${{ matrix.build_type }} --target package + + - name: test + shell: bash + run: | + cmake --build build --config ${{ matrix.build_type }} --target RUN_TESTS From 69438bb33157c9b67270eabb059bc9ba1c04e5df Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Wed, 4 Jun 2025 19:20:43 +0300 Subject: [PATCH 2/2] Add cache --- .github/workflows/build.yml | 35 +++++++++++++++++++++++++++++++++-- 1 file changed, 33 insertions(+), 2 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 61c1316f..c7ee20f5 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -21,11 +21,22 @@ jobs: - os: windows-latest triplet: x64-windows-release build_type: Release + test_target: RUN_TESTS + binary_cache: C:\Users\runneradmin\AppData\Local\vcpkg\archives + vcpkg_path: C:/vcpkg/installed/vcpkg/info/* + steps: - uses: actions/checkout@v4 with: submodules: true + - name: Restore cache dependencies + uses: actions/cache/restore@v4 + with: + path: ${{ matrix.binary_cache }} + key: ${{ matrix.os }} + restore-keys: ${{ matrix.os }} + - name: "Install dependencies" run: > vcpkg x-set-installed --triplet ${{ matrix.triplet }} @@ -43,13 +54,33 @@ jobs: fcl pkgconf + - name: copy files for hash + shell: bash + run: | + VCPKG_BASH_PATH=${VCPKG_INSTALLATION_ROOT//\\//} + echo $VCPKG_BASH_PATH + mkdir -p vcpkg-info + find $VCPKG_BASH_PATH/installed/ -type f -name 'vcpkg_abi_info.txt' | \ + while read filepath; do + triplet=$(echo "$filepath" | awk -F/ '{print $(NF-3)}') + port=$(echo "$filepath" | awk -F/ '{print $(NF-1)}') + cp "$filepath" "vcpkg-info/${triplet}_${port}.txt" + done + + - name: Save cache dependencies + id: cache-save + uses: actions/cache/save@v4 + with: + path: ${{ matrix.binary_cache }} + key: ${{ matrix.os }}-${{ hashFiles('vcpkg-info/*') }} + - name: cmake generate shell: bash run: > cmake -B build -DCMAKE_TOOLCHAIN_FILE=$VCPKG_INSTALLATION_ROOT/scripts/buildsystems/vcpkg.cmake -DVCPKG_TARGET_TRIPLET=${{ matrix.triplet }} - -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} + -DCMAKE_BUILD_TYPE=${{ matrix.build_type }} -DOMPL_VERSIONED_INSTALL=OFF -DOMPL_BUILD_DEMOS=OFF -DOMPL_BUILD_PYBINDINGS=OFF @@ -64,4 +95,4 @@ jobs: - name: test shell: bash run: | - cmake --build build --config ${{ matrix.build_type }} --target RUN_TESTS + cmake --build build --config ${{ matrix.build_type }} --target ${{ matrix.test_target }}