From d38d9c9243d87610c301fd9b636f2984695982dd Mon Sep 17 00:00:00 2001 From: Osyotr Date: Wed, 10 Apr 2024 01:38:24 +0300 Subject: [PATCH] WIP windows action --- .github/workflows/windows-check.yaml | 99 ++++++++++++++++++++++++++++ configure.sh | 4 +- 2 files changed, 101 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/windows-check.yaml diff --git a/.github/workflows/windows-check.yaml b/.github/workflows/windows-check.yaml new file mode 100644 index 0000000000000..3b21e50541142 --- /dev/null +++ b/.github/workflows/windows-check.yaml @@ -0,0 +1,99 @@ +name: Windows check +on: + workflow_dispatch: # Manual trigger + push: + branches: + - master + pull_request: + paths-ignore: + - .gitignore + - .github/** + - '!.github/workflows/windows-check.yaml' # Run check on self change + - CONTRIBUTORS + - LICENSE + - NOTICE + - README.md + - android/** + - iphone/** + - data/strings/** + - docs/** + - packaging/** + - platform/*apple* + - platform/*_android* + - platform/*_ios* + - platform/*_mac* + - platform/*_linux* + - pyhelpers/** + - tools/** + - '!tools/python/test_server/**' + - xcode/** + +jobs: + windows-matrix: + name: Windows builds + runs-on: windows-latest + strategy: + fail-fast: false + matrix: + build_type: [{ CMAKE_BUILD_TYPE: Debug, CMAKE_MSVC_RUNTIME_LIBRARY: MultiThreadedDebug }, { CMAKE_BUILD_TYPE: Release, CMAKE_MSVC_RUNTIME_LIBRARY: MultiThreaded }] + # Cancels previous jobs if the same branch or PR was updated again. + concurrency: + group: ${{ github.workflow }}-${{ matrix.build_type.CMAKE_BUILD_TYPE }}-${{ github.event.pull_request.number || github.ref }} + cancel-in-progress: true + + steps: + - name: Checkout sources + uses: actions/checkout@v4 + + # Can probably skip more since we use vcpkg + - name: Parallel submodules checkout + shell: bash + run: | + git \ + -c submodule."3party/Vulkan-Headers".update=none \ + -c submodule."3party/boost".update=none \ + -c submodule."3party/expat".update=none \ + -c submodule."3party/freetype".update=none \ + -c submodule."3party/gflags".update=none \ + -c submodule."3party/googletest".update=none \ + -c submodule."3party/harfbuzz".update=none \ + -c submodule."3party/icu".update=none \ + -c submodule."3party/jansson".update=none \ + -c submodule."3party/protobuf".update=none \ + -c submodule."3party/pugixml".update=none \ + -c submodule."3party/utfcpp".update=none \ + submodule update --depth 1 --init --recursive --jobs=$(($(nproc) * 20)) + + - name: Install CMake and Ninja + uses: lukka/get-cmake@latest + with: + cmakeVersion: 3.29.0 + + - name: Developer Command Prompt for Microsoft Visual C++ + uses: ilammy/msvc-dev-cmd@v1 + with: + # See https://github.com/actions/runner-images/issues/9398 + toolset: 14.39 + + # Remove? + - name: Configure + shell: bash + run: ./configure.sh + + - name: CMake + shell: bash + run: | + echo "Building ${{ matrix.build_type.CMAKE_BUILD_TYPE }}" + cmake . -B build -G Ninja -DCMAKE_BUILD_TYPE=${{ matrix.build_type.CMAKE_MSVC_RUNTIME_LIBRARY }} \ + -DCMAKE_MSVC_RUNTIME_LIBRARY=${{ matrix.build_type.CMAKE_BUILD_TYPE }} \ + -DWITH_SYSTEM_PROVIDED_3PARTY=ON \ + -DUNITY_DISABLE=ON + -DOMIM_USE_VCPKG=ON \ + -DVCPKG_TARGET_TRIPLET=x64-windows-static \ + -DVCPKG_HOST_TRIPLET=x64-windows-static \ + -DVCPKG_INSTALL_OPTIONS="--disable-metrics;--no-print-usage;--x-abi-tools-use-exact-versions;--clean-buildtrees-after-build;--clean-packages-after-build" + + - name: Compile + shell: bash + working-directory: build + run: ninja diff --git a/configure.sh b/configure.sh index 81abcd0514655..aa1ed5c5ea437 100755 --- a/configure.sh +++ b/configure.sh @@ -135,12 +135,12 @@ fi if [ ! -d "$BASE_PATH/3party/boost/" ]; then echo "You need to have Boost submodule present to run bootstrap.sh" echo "Try 'git submodule update --init --recursive'" - exit 1 + #exit 1 fi if [ ! -d "$BASE_PATH/3party/boost/tools" ]; then echo "Boost's submodule 'tools' is missing, it is required for bootstrap" echo "Try 'git submodule update --init --recursive'" - exit 1 + #exit 1 fi cd "$BASE_PATH/3party/boost/"