[Openvpn-devel,v1] GHA: Add caching for vcpkg builds
Commit Message
From: Frank Lichtenheld <frank@lichtenheld.com>
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
---
This change was reviewed on Gerrit and approved by at least one
developer. I request to merge it to master.
Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/1642
This mail reflects revision 1 of this Change.
Acked-by according to Gerrit (reflected above):
Yuriy Darnobyt <yura.uddr@gmail.com>
Comments
Avoiding unneccessary re-builds is a very welcome addition - it speeds
up our test runs, and it avoids burning more energy than needed.
Yuriy and GHA agree that "this works".
Your patch has been applied to the master and release/2.7 branch.
commit 157087736427059316ecff7dd21e16b54077221a (master)
commit 064f912b4dfa18ea775e33bcf817c75b3c847e54 (release/2.7)
Author: Frank Lichtenheld
Date: Wed Apr 29 11:39:33 2026 +0200
GHA: Add caching for vcpkg builds
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>
--
kind regards,
Gert Doering
@@ -42,14 +42,23 @@
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 @@
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 @@
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 @@
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 @@
- 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' }}
@@ -27,7 +27,7 @@
"/^\\.github/workflows/.+\\.ya?ml$/"
],
"matchStrings": [
- "vcpkgGitCommitId:\\s*(?<currentDigest>.*?)\\n"
+ "VCPKG_GIT_COMMIT_ID:\\s*(?<currentDigest>.*?)\\n"
],
"currentValueTemplate": "master",
"depNameTemplate": "vcpkg",