From a682691df9c72baaa7a4525a88e81d6fe7053254 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 18 Sep 2024 12:16:12 -0400 Subject: [PATCH 1/3] create stable cache of vcpkg directory --- .github/actions/build/action.yml | 5 +++++ CMakePresets.json | 2 +- vcpkg.json | 9 +++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index b518773f..f11ba27c 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -41,6 +41,11 @@ runs: - uses: lukka/get-cmake@v3.30.1 + - uses: actions/cache@v4 + with: + key: vcpkg-${{ inputs.target }}-${{ hashFiles('./vcpkg.json') }} + path: './vcpkg' + - uses: lukka/run-vcpkg@v11 - uses: lukka/run-cmake@v10 diff --git a/CMakePresets.json b/CMakePresets.json index 2fc56eda..5b2325ca 100644 --- a/CMakePresets.json +++ b/CMakePresets.json @@ -11,7 +11,7 @@ "hidden": true, "cacheVariables": { "ziti_DEVELOPER_MODE": "ON", - "VCPKG_MANIFEST_FEATURES": "test;samples" + "VCPKG_MANIFEST_FEATURES": "dev-features" } }, { diff --git a/vcpkg.json b/vcpkg.json index 9c0674fd..88094018 100644 --- a/vcpkg.json +++ b/vcpkg.json @@ -31,6 +31,15 @@ "name": "cli11" } ] + }, + "dev-features": { + "description": "features for development", + "dependencies": [ + { + "name": "ziti", + "features": [ "test", "samples" ] + } + ] } }, "builtin-baseline": "1de2026f28ead93ff1773e6e680387643e914ea1" From 2178f0204feace000eaa7836f245d10abd1f1b04 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 18 Sep 2024 13:11:19 -0400 Subject: [PATCH 2/3] only need to cache vcpkg/packages --- .github/actions/build/action.yml | 4 ++-- .github/workflows/cmake.yml | 3 +++ 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index f11ba27c..40b2b416 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -43,8 +43,8 @@ runs: - uses: actions/cache@v4 with: - key: vcpkg-${{ inputs.target }}-${{ hashFiles('./vcpkg.json') }} - path: './vcpkg' + key: deps-${{ inputs.target }}-${{ hashFiles('./vcpkg.json') }} + path: './vcpkg/packages' - uses: lukka/run-vcpkg@v11 diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml index ade3aed4..ec3057a5 100644 --- a/.github/workflows/cmake.yml +++ b/.github/workflows/cmake.yml @@ -2,6 +2,9 @@ name: C/C++ CI on: workflow_dispatch: + push: + branches: + - main pull_request: branches: - main From 4eae7ba6f723901295f620ec7f8d97f1f13f9575 Mon Sep 17 00:00:00 2001 From: eugene Date: Wed, 18 Sep 2024 13:19:07 -0400 Subject: [PATCH 3/3] restore packages after vcpkg setup --- .github/actions/build/action.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/actions/build/action.yml b/.github/actions/build/action.yml index 40b2b416..aa70f6f6 100644 --- a/.github/actions/build/action.yml +++ b/.github/actions/build/action.yml @@ -41,13 +41,13 @@ runs: - uses: lukka/get-cmake@v3.30.1 + - uses: lukka/run-vcpkg@v11 + - uses: actions/cache@v4 with: key: deps-${{ inputs.target }}-${{ hashFiles('./vcpkg.json') }} path: './vcpkg/packages' - - uses: lukka/run-vcpkg@v11 - - uses: lukka/run-cmake@v10 name: Configure CMake with: