Skip to content

Commit

Permalink
github: enable sccache debug logging and artifact output
Browse files Browse the repository at this point in the history
  • Loading branch information
ahayzen-kdab committed Feb 14, 2025
1 parent a751285 commit 55791c8
Showing 1 changed file with 20 additions and 1 deletion.
21 changes: 20 additions & 1 deletion .github/workflows/github-cxx-qt-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -263,6 +263,7 @@ jobs:
ctest_args: --exclude-regex '^(example_qml_features_test_valgrind|example_qml_minimal_myobject_test_valgrind)$'
qt_qpa_platform: offscreen
compiler_cache_path: /home/runner/.cache/sccache
sccache_log_path: /home/runner/.cache/sccache_log.txt
clang_format_path: /home/runner/.local/bin/clang-format
cargo_dir: ~/.cargo
rustc_wrapper: sccache
Expand All @@ -278,6 +279,7 @@ jobs:
ctest_args: --exclude-regex '^(example_qml_features_test_valgrind|example_qml_minimal_myobject_test_valgrind)$'
qt_qpa_platform: offscreen
compiler_cache_path: /home/runner/.cache/sccache
sccache_log_path: /home/runner/.cache/sccache_log.txt
clang_format_path: /home/runner/.local/bin/clang-format
cargo_dir: ~/.cargo
rustc_wrapper: sccache
Expand All @@ -301,6 +303,7 @@ jobs:
ctest_args: --exclude-regex '^(cargo_clippy|cargo_doc|example_qml_features_test|example_qml_minimal_myobject_test|cargo_build_rerun|.*valgrind)$'
qt_qpa_platform: cocoa
compiler_cache_path: /Users/runner/Library/Caches/Mozilla.sccache
sccache_log_path: /Users/runner/Library/Caches/Mozilla.sccache.log.txt
clang_format_path: /Users/runner/Library/Python/3.13/bin/clang-format
cargo_dir: ~/.cargo
cc: clang
Expand All @@ -322,6 +325,7 @@ jobs:
ctest_args: --exclude-regex '^(cargo_clippy|cargo_doc|example_qml_features_test|example_qml_minimal_myobject_test|cargo_build_rerun|.*valgrind)$'
qt_qpa_platform: cocoa
compiler_cache_path: /Users/runner/Library/Caches/Mozilla.sccache
sccache_log_path: /Users/runner/Library/Caches/Mozilla.sccache.log.txt
clang_format_path: /Users/runner/Library/Python/3.13/bin/clang-format
cargo_dir: ~/.cargo
cc: clang
Expand Down Expand Up @@ -356,6 +360,7 @@ jobs:
exe_suffix: .exe
qt_qpa_platform: windows
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
sccache_log_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\log.txt
clang_format_path: C:\Users\runneradmin\AppData\Roaming\Python\Python39\Scripts\clang-format.exe
cargo_dir: C:\Users\runneradmin\.cargo
cc: cl
Expand All @@ -372,6 +377,7 @@ jobs:
exe_suffix: .exe
qt_qpa_platform: windows
compiler_cache_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\cache
sccache_log_path: C:\Users\runneradmin\AppData\Local\Mozilla\sccache\log.txt
clang_format_path: C:\Users\runneradmin\AppData\Roaming\Python\Python39\Scripts\clang-format.exe
cargo_dir: C:\Users\runneradmin\.cargo
cc: cl
Expand All @@ -388,6 +394,8 @@ jobs:
# Allow a larger cache size so that code in branches can be cached
# but still leave room for the tools cache
SCCACHE_CACHE_SIZE: 600M
SCCACHE_LOG: debug
SCCACHE_ERROR_LOG: ${{ matrix.sccache_log_path }}

steps:
- name: "Clone Git repository"
Expand Down Expand Up @@ -500,6 +508,10 @@ jobs:
run: cmake --build build --config Release --parallel ${{ matrix.cores }}
env:
RUSTC_WRAPPER: ${{ matrix.rustc_wrapper }}

- name: "Print compiler cache statistics"
run: sccache --show-stats

- name: "Test"
run: ctest ${{ matrix.ctest_args }} -C Release -T test --output-on-failure --parallel ${{ matrix.cores }}
working-directory: ./build
Expand All @@ -514,7 +526,6 @@ jobs:
- name: "Print compiler cache statistics"
run: sccache --show-stats


# This is a workaround for the fact that GH doesn't support updating existing caches.
# See: https://github.com/azu/github-actions-overwrite-cache-example
- name: "Delete previous compiler cache"
Expand All @@ -535,3 +546,11 @@ jobs:
with:
path: ${{ matrix.compiler_cache_path }}
key: ${{ matrix.name }}_compiler_cache

- name: Upload GitHub Actions artifacts of sccache debug log
if: always()
uses: actions/upload-artifact@v4
with:
name: sccache_log_${{ matrix.name }}
path: ${{ matrix.sccache_log_path }}
if-no-files-found: ignore

0 comments on commit 55791c8

Please sign in to comment.