From 44a19aab95d87dc33c330165e6a2f88dd2a99435 Mon Sep 17 00:00:00 2001 From: Naomi Kirby Date: Thu, 29 Aug 2024 18:07:04 -0700 Subject: [PATCH] Cache Wireguard-NT for windows unit tests (#9816) --- .github/workflows/test_unit.yaml | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/.github/workflows/test_unit.yaml b/.github/workflows/test_unit.yaml index 642225149d..e317d97e4c 100644 --- a/.github/workflows/test_unit.yaml +++ b/.github/workflows/test_unit.yaml @@ -144,10 +144,25 @@ jobs: cache: "pip" - run: pip install -r requirements.txt + - name: Cache Wireguard NT + id: cache-wireguard-nt + uses: actions/cache@v4 + with: + path: 3rdparty/wireguard-nt + key: wireguard-nt-${{ hashFiles('windows/wireguard_nt/CMakeLists.txt') }} + + - name: Download Wireguard NT + if: steps.cache-wireguard-nt.outputs.cache-hit != 'true' + shell: bash + run: | + WIREGUARD_NT_URL=$(grep -Eo 'DOWNLOAD[[:space:]].*' windows/wireguard_nt/CMakeLists.txt | awk '{print $2}') + curl -sSL -o wireguard-nt.zip $WIREGUARD_NT_URL + unzip -d 3rdparty/ wireguard-nt.zip + - name: Building tests run: | mkdir ./build - cmake -S . -B ./build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\MozillaVPNBuild\lib\cmake" -DWINTUN_FOLDER="not-existing" + cmake -S . -B ./build -GNinja -DCMAKE_BUILD_TYPE=Debug -DCMAKE_PREFIX_PATH="C:\MozillaVPNBuild\lib\cmake" -DWIREGUARD_FOLDER="3rdparty/wireguard-nt" cmake --build ./build --target build_tests - name: Running native messaging tests