GHA: Add caching for vcpkg builds

The nice automatic caching was removed last year,
so go back to manual caching of the binary cache
dir.

While here, also update vcpkg to latest master.

Change-Id: I933227aa4bc4f05b58d0e754b4330da807504d01
Signed-off-by: Frank Lichtenheld <frank@lichtenheld.com>
Acked-by: Yuriy Darnobyt <yura.uddr@gmail.com>
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1642
Message-Id: <20260429093938.23601-1-gert@greenie.muc.de>
URL: https://www.mail-archive.com/openvpn-devel@lists.sourceforge.net/msg36775.html
Signed-off-by: Gert Doering <gert@greenie.muc.de>
(cherry picked from commit 1570877364)
This commit is contained in:
Frank Lichtenheld 2026-04-29 11:39:33 +02:00 committed by Gert Doering
parent 8c7bacc45f
commit 064f912b4d
2 changed files with 40 additions and 8 deletions

View file

@ -42,14 +42,23 @@ jobs:
VCPKG_DEFAULT_TRIPLET: ${{ matrix.vcpkg_triplet }}
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_INSTALLED_DIR: ${{ github.workspace }}/vcpkg/installed
VCPKG_BINARY_SOURCES: clear;default,readwrite
VCPKG_GIT_COMMIT_ID: 031f4afe03be385aee354f15be6e6b1fe57497c7
steps:
- name: Checkout OpenVPN
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: lukka/get-cmake@7bfc9baacbbdcb5e37957ad05c3546b3e222be3c # v4.3.2
- name: Install vcpkg
- name: Setup vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: e5a1490e1409d175932ef6014519e9ae149ddb7c
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}
- name: Set up vcpkg binary cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: android-${{ matrix.abi }}-vcpkg-binary-cache-${{ env.VCPKG_GIT_COMMIT_ID }}
restore-keys: |
android-${{ matrix.abi }}-vcpkg-binary-cache-
- name: Install dependencies
run: ${VCPKG_ROOT}/vcpkg install openssl lz4 cmocka
- name: configure OpenVPN with cmake
@ -70,10 +79,12 @@ jobs:
arch: [x86, x64]
build: [Release, Debug]
name: "gcc-mingw - ${{ matrix.arch }} - ${{matrix.build }} - OSSL"
name: "gcc-mingw - ${{ matrix.arch }} - ${{ matrix.build }} - OSSL"
runs-on: ubuntu-24.04
env:
VCPKG_ROOT: ${{ github.workspace }}/vcpkg
VCPKG_BINARY_SOURCES: clear;default,readwrite
VCPKG_GIT_COMMIT_ID: 031f4afe03be385aee354f15be6e6b1fe57497c7
steps:
- name: Install dependencies
run: sudo apt update && sudo apt install -y mingw-w64 unzip build-essential wget python3-docutils man2html-base
@ -81,12 +92,21 @@ jobs:
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- uses: lukka/get-cmake@7bfc9baacbbdcb5e37957ad05c3546b3e222be3c # v4.3.2
- name: Restore from cache and install vcpkg
- name: Setup vcpkg
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: e5a1490e1409d175932ef6014519e9ae149ddb7c
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}
vcpkgJsonGlob: '**/mingw/vcpkg.json'
- name: Set up vcpkg binary cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: mingw-${{ matrix.arch }}-vcpkg-binary-cache-${{ hashFiles('**/mingw/vcpkg.json') }}-${{ env.VCPKG_GIT_COMMIT_ID }}
restore-keys: |
mingw-${{ matrix.arch }}-vcpkg-binary-cache-${{ hashFiles('**/mingw/vcpkg.json') }}-
mingw-${{ matrix.arch }}-vcpkg-binary-cache-
- name: Run CMake with vcpkg.json manifest
uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9
with:
@ -262,6 +282,8 @@ jobs:
name: "msbuild - ${{ matrix.arch }} - openssl"
env:
BUILD_CONFIGURATION: Release
VCPKG_BINARY_SOURCES: clear;default,readwrite
VCPKG_GIT_COMMIT_ID: 031f4afe03be385aee354f15be6e6b1fe57497c7
runs-on: windows-2025
steps:
@ -271,12 +293,22 @@ jobs:
- name: Install rst2html
run: python -m pip install --upgrade pip docutils
- name: Restore artifacts, or setup vcpkg (do not install any package)
- name: Setup vcpkg (do not install any package)
uses: lukka/run-vcpkg@b1a0dd252f06b9e25b3c022a9a03bd7a427fb6a2 # v11.6
with:
vcpkgGitCommitId: e5a1490e1409d175932ef6014519e9ae149ddb7c
vcpkgGitCommitId: ${{ env.VCPKG_GIT_COMMIT_ID }}
vcpkgJsonGlob: '**/windows/vcpkg.json'
- name: Set up vcpkg binary cache
uses: actions/cache@27d5ce7f107fe9357f9df03efb73ab90386fccae # v5.0.5
with:
path: ${{ env.VCPKG_DEFAULT_BINARY_CACHE }}
key: msvc-${{ matrix.arch }}-vcpkg-binary-cache-${{ hashFiles('**/windows/vcpkg.json') }}-${{ env.VCPKG_GIT_COMMIT_ID }}
restore-keys: |
msvc-${{ matrix.arch }}-vcpkg-binary-cache-${{ hashFiles('**/windows/vcpkg.json') }}-
msvc-${{ matrix.arch }}-vcpkg-binary-cache-
- name: Run CMake with vcpkg.json manifest (NO TESTS)
uses: lukka/run-cmake@5d55ea7949e25f69f0ecb516d8d572297e03a956 # v10.9
if: ${{ matrix.arch == 'arm64' }}

View file

@ -27,7 +27,7 @@
"/^\\.github/workflows/.+\\.ya?ml$/"
],
"matchStrings": [
"vcpkgGitCommitId:\\s*(?<currentDigest>.*?)\\n"
"VCPKG_GIT_COMMIT_ID:\\s*(?<currentDigest>.*?)\\n"
],
"currentValueTemplate": "master",
"depNameTemplate": "vcpkg",