Skip to content

Commit

Permalink
fix: add unix timestamp to cache key
Browse files Browse the repository at this point in the history
  • Loading branch information
luishfonseca committed Sep 26, 2023
1 parent d76644c commit f64a31c
Show file tree
Hide file tree
Showing 3 changed files with 35 additions and 8 deletions.
13 changes: 11 additions & 2 deletions .github/workflows/build-engine-linux.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,21 @@ jobs:
sudo apt-get update
sudo apt-get install xorg-dev libglu1-mesa-dev gcc-11 g++-11 ccache
- name: Get timestamp
shell: bash
id: ccache_vars
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
restore-keys: |
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-
ccache-
- name: Configure CMake
run: cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_CORE_SAMPLES=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
Expand Down
13 changes: 11 additions & 2 deletions .github/workflows/build-engine-macos.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,12 +26,21 @@ jobs:
run: |
brew install glfw llvm@14 ccache
- name: Get timestamp
shell: bash
id: ccache_vars
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
restore-keys: |
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-
ccache-
- name: Configure CMake
run: CC=$(brew --prefix llvm@14)/bin/clang CXX=$(brew --prefix llvm@14)/bin/clang++ cmake -B ${{github.workspace}}/build -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DGLFW_USE_SUBMODULE=OFF -DBUILD_CORE_SAMPLES=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
Expand Down
17 changes: 13 additions & 4 deletions .github/workflows/build-engine-windows.yml
Original file line number Diff line number Diff line change
Expand Up @@ -26,15 +26,24 @@ jobs:
run: |
choco install ccache
- name: Create Build Env
run: cmake -E make_directory ${{github.workspace}}\build
- name: Get timestamp
shell: bash
id: ccache_vars
run: |
echo "timestamp=$(date +%s)" >> $GITHUB_OUTPUT
- uses: actions/cache@v3
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}
key: ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-${{ steps.ccache_vars.outputs.timestamp }}
restore-keys: |
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-${{ github.ref }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-${{ env.BUILD_TYPE }}-
ccache-${{ env.CCACHE_COMPILERTYPE }}-
ccache-
- name: Create Build Env
run: cmake -E make_directory ${{github.workspace}}\build

- name: Configure CMake
run: cmake -B ${{github.workspace}}\build -G "Visual Studio 17 2022" -DCMAKE_BUILD_TYPE=${{env.BUILD_TYPE}} -DBUILD_CORE_SAMPLES=ON -DBUILD_CORE_TESTS=ON -DBUILD_ENGINE_SAMPLES=ON -DUSE_CLANG_TIDY=OFF
Expand Down

0 comments on commit f64a31c

Please sign in to comment.