From 60b1d49ae67d0b4625ada1aeede718f68d8677b7 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:39:50 -0400 Subject: [PATCH 1/8] Adding manifest file --- vcpkg.json | 9 +++++++++ 1 file changed, 9 insertions(+) create mode 100644 vcpkg.json diff --git a/vcpkg.json b/vcpkg.json new file mode 100644 index 0000000..8d277db --- /dev/null +++ b/vcpkg.json @@ -0,0 +1,9 @@ +{ + "$schema": "https://raw.githubusercontent.com/microsoft/vcpkg-tool/main/docs/vcpkg.schema.json", + "dependencies": [ + "nlohmann-json", + "curl", + "openssl", + "cpr" + ] +} From ae3b18c21f5e1d533941d8ed13f16cce4182ea23 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:41:47 -0400 Subject: [PATCH 2/8] Moved submodule directory Moved where vcpkg is located to address GitHub Actions build failure --- .gitmodules | 2 +- 3rdparty/vcpkg => vcpkg | 0 2 files changed, 1 insertion(+), 1 deletion(-) rename 3rdparty/vcpkg => vcpkg (100%) diff --git a/.gitmodules b/.gitmodules index 90e3bc2..72d488d 100644 --- a/.gitmodules +++ b/.gitmodules @@ -1,3 +1,3 @@ [submodule "3rdparty/vcpkg"] - path = 3rdparty/vcpkg + path = vcpkg url = https://github.com/microsoft/vcpkg diff --git a/3rdparty/vcpkg b/vcpkg similarity index 100% rename from 3rdparty/vcpkg rename to vcpkg From 9957a7c6ebaa6ab027081d649a0b47e38fe3dc9a Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:45:54 -0400 Subject: [PATCH 3/8] Updated workflow --- .github/workflows/cmake.yml | 136 +++++++++++++++++++++++++++--------- 1 file changed, 104 insertions(+), 32 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index c597d99..d5cdd0d 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,41 +1,113 @@ -name: CMake +# name: CMake +# +# on: +# push: +# branches: [ "master" ] +# pull_request: +# branches: [ "master" ] +# +# env: +# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) +# BUILD_TYPE: Release +# +# jobs: +# build: +# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. +# # You can convert this to a matrix build if you need cross-platform coverage. +# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix +# runs-on: ubuntu-latest +# +# steps: +# - uses: actions/checkout@v3 +# +# - name: run-vcpkg +# uses: lukka/run-vcpkg@v11.1 +# +# +# - name: Configure CMake +# # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. +# # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type +# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} +# +# - name: Build +# # Build your program with the given configuration +# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} +# +# - name: Test +# working-directory: ${{github.workspace}}/build +# # Execute tests defined by the CMake configuration. +# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail +# run: ctest -C ${{env.BUILD_TYPE}} -on: - push: - branches: [ "master" ] - pull_request: - branches: [ "master" ] -env: - # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) - BUILD_TYPE: Release + +# Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa +# Released under the term specified in file LICENSE.txt +# SPDX short identifier: MIT +# +# The peculiarity of this workflow is that assumes vcpkg stored as a submodule of this +# repository. +# The workflow does the following: +# - Sets up vcpkg if needed, then run CMake with CMakePreset.json using a configuration +# that leverages the vcpkg's toolchain file. +# This will automatically run vcpkg to install dependencies described by the vcpkg.json +# manifest file. +# vcpkg's Binary Caching backed by GH Action cache is being used. It will be a no-op if +# the dependencies are restored from GH Action cache. +# - Finally builds the sources with Ninja. +name: hosted-ninja_multi-vcpkg_submod-triplet-cacheoff +on: [push, workflow_dispatch] jobs: - build: - # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. - # You can convert this to a matrix build if you need cross-platform coverage. - # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix - runs-on: ubuntu-latest + job: + name: ${{ matrix.os }}-${{ github.workflow }} + runs-on: ${{ matrix.os }} + strategy: + fail-fast: false + matrix: + os: [ubuntu-latest, macos-latest, windows-latest] + include: + - os: windows-latest + triplet: x64-windows + - os: ubuntu-latest + triplet: x64-linux + - os: macos-latest + triplet: x64-osx + + env: + VCPKG_DEFAULT_TRIPLET: ${{ matrix.triplet }} steps: - - uses: actions/checkout@v3 - - - name: run-vcpkg - uses: lukka/run-vcpkg@v11.1 + - uses: actions/checkout@v3 + with: + submodules: true + - uses: lukka/get-cmake@latest + - name: dir + run: find $RUNNER_WORKSPACE + shell: bash - - name: Configure CMake - # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. - # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type - run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} - - - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - - - name: Test - working-directory: ${{github.workspace}}/build - # Execute tests defined by the CMake configuration. - # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail - run: ctest -C ${{env.BUILD_TYPE}} + - name: Setup vcpkg + uses: lukka/run-vcpkg@main + id: runvcpkg + with: + # This one is not needed, as it is the default value anyway. + # vcpkgDirectory: '${{ github.workspace }}/vcpkg' + vcpkgJsonGlob: '**/cmakepresets/vcpkg.json' + - name: List $RUNNER_WORKSPACE before build + run: find $RUNNER_WORKSPACE + shell: bash + - name: Prints output of run-vcpkg's action. + run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " + - name: Run CMake+vcpkg+NinjaMulti-Config (Release configuration) + uses: lukka/run-cmake@v10 + id: runcmake + with: + cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt' + configurePreset: 'ninja-multi-vcpkg' + buildPreset: 'ninja-multi-vcpkg' + buildPresetAdditionalArgs: '[`--config Release`]' + - name: List $RUNNER_WORKSPACE after build + run: find $RUNNER_WORKSPACE + shell: bash From 878810635279490e05e3362b4f6b6c04f129aa94 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:51:23 -0400 Subject: [PATCH 4/8] Workflow changes --- .github/workflows/cmake.yml | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index d5cdd0d..85c862a 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -100,14 +100,14 @@ jobs: shell: bash - name: Prints output of run-vcpkg's action. run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " - - name: Run CMake+vcpkg+NinjaMulti-Config (Release configuration) - uses: lukka/run-cmake@v10 - id: runcmake - with: - cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt' - configurePreset: 'ninja-multi-vcpkg' - buildPreset: 'ninja-multi-vcpkg' - buildPresetAdditionalArgs: '[`--config Release`]' +# - name: Run CMake+vcpkg+NinjaMulti-Config (Release configuration) +# uses: lukka/run-cmake@v10 +# id: runcmake +# with: +# cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt' +# configurePreset: 'ninja-multi-vcpkg' +# buildPreset: 'ninja-multi-vcpkg' +# buildPresetAdditionalArgs: '[`--config Release`]' - name: List $RUNNER_WORKSPACE after build run: find $RUNNER_WORKSPACE shell: bash From 31b633e5f86d030c52df47ac5d3030dcfb921c39 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:56:51 -0400 Subject: [PATCH 5/8] Cleanup --- .github/workflows/cmake.yml | 67 ------------------------------------- 1 file changed, 67 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 85c862a..15e972f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -1,60 +1,3 @@ -# name: CMake -# -# on: -# push: -# branches: [ "master" ] -# pull_request: -# branches: [ "master" ] -# -# env: -# # Customize the CMake build type here (Release, Debug, RelWithDebInfo, etc.) -# BUILD_TYPE: Release -# -# jobs: -# build: -# # The CMake configure and build commands are platform agnostic and should work equally well on Windows or Mac. -# # You can convert this to a matrix build if you need cross-platform coverage. -# # See: https://docs.github.com/en/free-pro-team@latest/actions/learn-github-actions/managing-complex-workflows#using-a-build-matrix -# runs-on: ubuntu-latest -# -# steps: -# - uses: actions/checkout@v3 -# -# - name: run-vcpkg -# uses: lukka/run-vcpkg@v11.1 -# -# -# - name: Configure CMake -# # Configure CMake in a 'build' subdirectory. `CMAKE_BUILD_TYPE` is only required if you are using a single-configuration generator such as make. -# # See https://cmake.org/cmake/help/latest/variable/CMAKE_BUILD_TYPE.html?highlight=cmake_build_type -# run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -# -# - name: Build -# # Build your program with the given configuration -# run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} -# -# - name: Test -# working-directory: ${{github.workspace}}/build -# # Execute tests defined by the CMake configuration. -# # See https://cmake.org/cmake/help/latest/manual/ctest.1.html for more detail -# run: ctest -C ${{env.BUILD_TYPE}} - - - -# Copyright (c) 2019-2020-2021-2022-2023 Luca Cappa -# Released under the term specified in file LICENSE.txt -# SPDX short identifier: MIT -# -# The peculiarity of this workflow is that assumes vcpkg stored as a submodule of this -# repository. -# The workflow does the following: -# - Sets up vcpkg if needed, then run CMake with CMakePreset.json using a configuration -# that leverages the vcpkg's toolchain file. -# This will automatically run vcpkg to install dependencies described by the vcpkg.json -# manifest file. -# vcpkg's Binary Caching backed by GH Action cache is being used. It will be a no-op if -# the dependencies are restored from GH Action cache. -# - Finally builds the sources with Ninja. name: hosted-ninja_multi-vcpkg_submod-triplet-cacheoff on: [push, workflow_dispatch] @@ -91,8 +34,6 @@ jobs: uses: lukka/run-vcpkg@main id: runvcpkg with: - # This one is not needed, as it is the default value anyway. - # vcpkgDirectory: '${{ github.workspace }}/vcpkg' vcpkgJsonGlob: '**/cmakepresets/vcpkg.json' - name: List $RUNNER_WORKSPACE before build @@ -100,14 +41,6 @@ jobs: shell: bash - name: Prints output of run-vcpkg's action. run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " -# - name: Run CMake+vcpkg+NinjaMulti-Config (Release configuration) -# uses: lukka/run-cmake@v10 -# id: runcmake -# with: -# cmakeListsTxtPath: '${{ github.workspace }}/cmakepresets/CMakeLists.txt' -# configurePreset: 'ninja-multi-vcpkg' -# buildPreset: 'ninja-multi-vcpkg' -# buildPresetAdditionalArgs: '[`--config Release`]' - name: List $RUNNER_WORKSPACE after build run: find $RUNNER_WORKSPACE shell: bash From 42dcbb87ed472c474e2fb8b45ba017fb9c853e0a Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 20:59:43 -0400 Subject: [PATCH 6/8] Adding build step to workflow --- .github/workflows/cmake.yml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 15e972f..56f2b43 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -41,6 +41,10 @@ jobs: shell: bash - name: Prints output of run-vcpkg's action. run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " + - name: Build + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + - name: List $RUNNER_WORKSPACE after build run: find $RUNNER_WORKSPACE shell: bash From 7abf5d5db2f00cdc7bcaa8234c9961a4fd8bcff9 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 21:01:15 -0400 Subject: [PATCH 7/8] Indentation issue --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 56f2b43..3b38d5f 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -42,8 +42,8 @@ jobs: - name: Prints output of run-vcpkg's action. run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " - name: Build - # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + # Build your program with the given configuration + run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: List $RUNNER_WORKSPACE after build run: find $RUNNER_WORKSPACE From 5d02c47b867d821ce125e19992aabe476f331ea5 Mon Sep 17 00:00:00 2001 From: kdeng00 Date: Fri, 4 Aug 2023 21:03:02 -0400 Subject: [PATCH 8/8] Workflow fix --- .github/workflows/cmake.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index 3b38d5f..a2fcccc 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -41,9 +41,9 @@ jobs: shell: bash - name: Prints output of run-vcpkg's action. run: echo "root='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_ROOT_OUT }}', triplet='${{ steps.runvcpkg.outputs.RUNVCPKG_VCPKG_DEFAULT_TRIPLET_OUT }}' " - - name: Build + # - name: Build # Build your program with the given configuration - run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} + # run: cmake --build ${{github.workspace}}/build --config ${{env.BUILD_TYPE}} - name: List $RUNNER_WORKSPACE after build run: find $RUNNER_WORKSPACE