CI: Upload build errors on failure.
diff --git a/.github/workflows/cmake.yml b/.github/workflows/cmake.yml
index 5113952..9100c67 100644
--- a/.github/workflows/cmake.yml
+++ b/.github/workflows/cmake.yml
@@ -61,3 +61,13 @@
     - name: Run test cases
       run: ctest -C Release --output-on-failure --max-width 120
       working-directory: ${{ matrix.build-dir || '.' }}
+
+    - name: Upload build errors
+      uses: actions/upload-artifact@v3
+      if: failure()
+      with:
+        name: ${{ matrix.name }} (cmake)
+        path: |
+          **/CMakeFiles/CMakeOutput.log
+          **/CMakeFiles/CMakeError.log
+        retention-days: 7
diff --git a/.github/workflows/configure.yml b/.github/workflows/configure.yml
index 09f67b4..da311a8 100644
--- a/.github/workflows/configure.yml
+++ b/.github/workflows/configure.yml
@@ -45,3 +45,12 @@
     - name: Run test cases
       run: make test
       working-directory: ${{ matrix.build-dir }}
+
+    - name: Upload build errors
+      uses: actions/upload-artifact@v3
+      if: failure()
+      with:
+        name: ${{ matrix.name }} (configure)
+        path: |
+          ${{ matrix.build-dir || '.' }}/configure.log
+        retention-days: 7