diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml new file mode 100644 index 00000000..c7ee20f5 --- /dev/null +++ b/.github/workflows/build.yml @@ -0,0 +1,98 @@ +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 + 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 }} + 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: 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 }} + -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 ${{ matrix.test_target }}