|
| 1 | +name: vcpkg |
| 2 | + |
| 3 | +on: |
| 4 | + push: |
| 5 | + pull_request: |
| 6 | + |
| 7 | + |
| 8 | +jobs: |
| 9 | + use_vcpkg: |
| 10 | + strategy: |
| 11 | + matrix: |
| 12 | + include: |
| 13 | + - CMAKE_GENERATOR_PLATFORM: x64 |
| 14 | + CMAKE_GENERATOR: "Visual Studio 17 2022" |
| 15 | + VCPKG_TARGET_TRIPLET: x64-windows |
| 16 | + VCPKG_PLATFORM_TOOLSET: v143 |
| 17 | + os: windows-2022 |
| 18 | + |
| 19 | + - VCPKG_TARGET_TRIPLET: x64-osx |
| 20 | + os: macos-15-intel |
| 21 | + |
| 22 | + # See: [About GitHub-hosted runners](https://docs.github.com/actions/using-github-hosted-runners/about-github-hosted-runners/about-github-hosted-runners) |
| 23 | + # See: [Choosing the runner for a job](https://docs.github.com/actions/writing-workflows/choosing-where-your-workflow-runs/choosing-the-runner-for-a-job) |
| 24 | + # See: https://github.com/actions/runner-images/ |
| 25 | + runs-on: ${{matrix.os}} |
| 26 | + |
| 27 | + env: |
| 28 | + BUILD_DIR: ${{github.workspace}}\build |
| 29 | + SOURCE_DIR: ${{github.workspace}}\.cache\source |
| 30 | + TOOLS_DIR: ${{github.workspace}}\.cache\tools |
| 31 | + INSTALL_DIR: ${{github.workspace}}\.cache\install |
| 32 | + VCPKGGITCOMMITID: 7213cf8135c329c37c7e2778e40774489a0583a8 |
| 33 | + VCPKG_TARGET_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}} |
| 34 | + VCPKG_DEFAULT_TRIPLET: ${{matrix.VCPKG_TARGET_TRIPLET}} |
| 35 | + VCPKG_PLATFORM_TOOLSET: ${{matrix.VCPKG_PLATFORM_TOOLSET}} |
| 36 | + VCPKG_MANIFEST_FEATURES: "freerdp;vnc;terminal;filetransfer;qt" |
| 37 | + VCPKG_INSTALLED_DIR: ${{github.workspace}}\.cache\install |
| 38 | + CMAKE_GENERATOR: ${{matrix.CMAKE_GENERATOR}} |
| 39 | + CMAKE_GENERATOR_PLATFORM: ${{matrix.CMAKE_GENERATOR_PLATFORM}} |
| 40 | + qt_modules: "${{matrix.qt_modules}}" |
| 41 | + artifact_name: build_msvc |
| 42 | + RabbitRemoteControl_VERSION: v0.0.36 |
| 43 | + |
| 44 | + # Map the job outputs to step outputs |
| 45 | + outputs: |
| 46 | + name: ${{ env.artifact_name }} |
| 47 | + |
| 48 | + steps: |
| 49 | + - name: Checkout Repository |
| 50 | + uses: actions/checkout@v3 |
| 51 | + with: |
| 52 | + submodules: recursive |
| 53 | + fetch-depth: 0 |
| 54 | + |
| 55 | + - name: Make directories |
| 56 | + run: | |
| 57 | + cmake -E make_directory ${{env.BUILD_DIR}} |
| 58 | + cmake -E make_directory ${{env.SOURCE_DIR}} |
| 59 | + cmake -E make_directory ${{env.TOOLS_DIR}} |
| 60 | + cmake -E make_directory ${{env.INSTALL_DIR}} |
| 61 | +
|
| 62 | + - name: Cache installed |
| 63 | + uses: actions/cache@v4 |
| 64 | + id: cache-installed |
| 65 | + with: |
| 66 | + path: | |
| 67 | + ${{env.INSTALL_DIR}} |
| 68 | + key: install_msvc_qt${{matrix.qt_version}}_${{matrix.qt_arch}}_${{matrix.BUILD_TYPE}} |
| 69 | + |
| 70 | + - name: run-vcpkg |
| 71 | + uses: lukka/run-vcpkg@v11 |
| 72 | + with: |
| 73 | + vcpkgGitCommitId: ${{env.VCPKGGITCOMMITID}} |
| 74 | + vcpkgDirectory: ${{env.SOURCE_DIR}}/vcpkg |
| 75 | + |
| 76 | + - name: RabbitCommon |
| 77 | + working-directory: ${{env.SOURCE_DIR}} |
| 78 | + run: git clone https://github.com/KangLin/RabbitCommon.git |
| 79 | + |
| 80 | + - name: Build RabbitRemoteControl with cmake preset |
| 81 | + if: false #${{ matrix.BUILD_TYPE == 'Release' && matrix.qt_version == '6.9.3' && startsWith(github.ref, 'refs/heads/master')}} |
| 82 | + working-directory: ${{github.workspace}} |
| 83 | + env: |
| 84 | + RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon |
| 85 | + run: | |
| 86 | + cmake --workflow --preset "msvc-x64-qt6" |
| 87 | +
|
| 88 | + - name: Build RabbitRemoteControl |
| 89 | + working-directory: ${{env.BUILD_DIR}} |
| 90 | + env: |
| 91 | + RabbitCommon_ROOT: ${{env.SOURCE_DIR}}/RabbitCommon |
| 92 | + run: | |
| 93 | + cmake ${{github.workspace}} ^ |
| 94 | + -A ${{matrix.CMAKE_GENERATOR_PLATFORM}} ^ |
| 95 | + -T ${{matrix.VCPKG_PLATFORM_TOOLSET}} ^ |
| 96 | + -DCMARK_SHARED=OFF ^ |
| 97 | + -DCMARK_TESTS=OFF ^ |
| 98 | + -DCMARK_STATIC=ON ^ |
| 99 | + -DWITH_CMARK=OFF ^ |
| 100 | + -DWITH_CMARK_GFM=ON ^ |
| 101 | + -DWITH_WebEngineWidgets=ON ^ |
| 102 | + -DRABBIT_ENABLE_INSTALL_DEPENDENT=ON ^ |
| 103 | + -DRABBIT_ENABLE_INSTALL_QT=ON ^ |
| 104 | + -DRABBIT_ENABLE_INSTALL_TO_BUILD_PATH=ON ^ |
| 105 | + -DCMAKE_BUILD_TYPE=${{matrix.BUILD_TYPE}} ^ |
| 106 | + -DCMAKE_INSTALL_PREFIX=${{env.BUILD_DIR}}/install ^ |
| 107 | + -DCMAKE_PREFIX_PATH=${{env.INSTALL_DIR}} ^ |
| 108 | + -DCMAKE_TOOLCHAIN_FILE=${{env.VCPKG_ROOT}}/scripts/buildsystems/vcpkg.cmake ^ |
| 109 | + -DVCPKG_VERBOSE=ON ^ |
| 110 | + -DVCPKG_TARGET_TRIPLET=${{matrix.VCPKG_TARGET_TRIPLET}} ^ |
| 111 | + -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON ^ |
| 112 | + -DVCPKG_APPLOCAL_DEPS=ON ^ |
| 113 | + -DVCPKG_TRACE_FIND_PACKAGE=ON ^ |
| 114 | + -DBUILD_QUIWidget=OFF ^ |
| 115 | + -DBUILD_APP=ON ^ |
| 116 | + -DBUILD_FREERDP=ON ^ |
| 117 | + -DPCAP_ROOT=${{env.INSTALL_DIR}}/npcap ^ |
| 118 | + -DPacket_ROOT=${{env.INSTALL_DIR}}/npcap ^ |
| 119 | + -DINSTALL_QTKEYCHAIN=ON |
| 120 | + cmake --build . --config ${{matrix.BUILD_TYPE}} |
0 commit comments