Skip to content

Commit

Permalink
increment branch cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
makslevental committed Aug 29, 2024
1 parent a8fdeea commit 5919494
Show file tree
Hide file tree
Showing 4 changed files with 16 additions and 4 deletions.
3 changes: 2 additions & 1 deletion .github/workflows/ci-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,8 @@ jobs:
fail-fast: true
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: linux-build-test-cpp-asserts-manylinux-v2-${{ github.event.number || github.ref_name }}
# either the PR number or `branch-N` where N always increments
CACHE_KEY: linux-build-test-cpp-asserts-manylinux-v2-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
runs-on: [macos-12, macos-14]
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.event.number || github.ref_name }}
CACHE_KEY: ${{ matrix.runs-on }}-build-test-cpp-asserts-v1-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ jobs:
fail-fast: true
env:
CACHE_DIR: ${{ github.workspace }}/.container-cache
CACHE_KEY: windows-build-test-cpp-asserts-v1-${{ github.event.number || github.ref_name }}
CACHE_KEY: windows-build-test-cpp-asserts-v1-${{ github.event.number || format('{0}-{1}', github.ref_name, github.run_number) }}
steps:
- name: Set unified TZ
uses: szenius/[email protected]
Expand Down
13 changes: 12 additions & 1 deletion build_tools/ci/build_test_cpp.sh
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,16 @@ export CCACHE_DIR="${cache_dir}/ccache"
export CCACHE_MAXSIZE="700M"
export CMAKE_C_COMPILER_LAUNCHER=ccache
export CMAKE_CXX_COMPILER_LAUNCHER=ccache
# https://interrupt.memfault.com/blog/ccache-debugging
export CCACHE_DEBUG=1
export CCACHE_DEBUGLEVEL=1
if [[ "$OSTYPE" == "linux-gnu"* ]]; then
export CCACHE_DEBUGDIR="/ccache-debug"
elif [[ "$OSTYPE" == "msys"* ]]; then
export CCACHE_DEBUGDIR="/c/ccache-debug"
fi
export CCACHE_SLOPPINESS=include_file_ctime,include_file_mtime
export CCACHE_COMPILERCHECK=content

# Clear ccache stats.
ccache -z
Expand Down Expand Up @@ -116,7 +126,8 @@ elif [[ "$OSTYPE" == "msys"* ]]; then
fi

# Show ccache stats.
ccache --show-stats
ccache --show-stats -v
grep -r 'Result: .*_miss' $CCACHE_DIR/$CCACHE_DEBUGDIR

rm -f "$install_dir"/bin/clang*
rm -f "$install_dir"/bin/llvm-link*
Expand Down

0 comments on commit 5919494

Please sign in to comment.