From 4835a4a33da1084230b556e71800461623919432 Mon Sep 17 00:00:00 2001
From: Dale Glass <dale@daleglass.net>
Date: Sun, 4 Jul 2021 01:41:32 +0200
Subject: [PATCH] Archive vcpkg logs, for debugging

This collects the logs generated during the vcpkg run, and
archives them as an artifact.
---
 .github/workflows/pr_build.yml | 16 +++++++++++++++-
 1 file changed, 15 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/pr_build.yml b/.github/workflows/pr_build.yml
index 8b4201f068..3cffad0b3d 100644
--- a/.github/workflows/pr_build.yml
+++ b/.github/workflows/pr_build.yml
@@ -25,6 +25,8 @@ env:
   # WIN32 specific variables
   PreferredToolArchitecture: X64
 
+  # Ensure XZ always runs with muticore support
+  XZ_OPT: -T0
 
 jobs:
   build:
@@ -140,6 +142,18 @@ jobs:
       working-directory: ${{runner.workspace}}/build
       shell: bash
       run: cmake $GITHUB_WORKSPACE -DCMAKE_BUILD_TYPE=$BUILD_TYPE -DVCPKG_BUILD_TYPE=release $CMAKE_EXTRA
+    - name: Compress cmake logs
+      if: always()
+      shell: bash
+      run: |
+        find "$HOME/vircadia-files/vcpkg" -name '*log' -type f -print0 | tar --null --force-local -T - -c --xz -v -f "${{ runner.workspace }}/cmake-logs.tar.xz"
+    - name: Archive cmake logs
+      if: always()
+      uses: actions/upload-artifact@v2
+      with:
+        name: cmake-logs
+        path: ${{ runner.workspace }}/cmake-logs.tar.xz
+        if-no-files-found: error
     - name: Build Application
       if: matrix.build_type == 'full' || matrix.build_type == 'client'
       working-directory: ${{runner.workspace}}/build
@@ -231,4 +245,4 @@ jobs:
         if [[ "${{ matrix.build_type }}" == "android" ]]; then
           cd $GITHUB_WORKSPACE/android
         fi
-        $PYTHON_EXEC "$GITHUB_WORKSPACE/tools/ci-scripts/upload_to_publish_server.py"
\ No newline at end of file
+        $PYTHON_EXEC "$GITHUB_WORKSPACE/tools/ci-scripts/upload_to_publish_server.py"