Skip to content

Commit

Permalink
[feat] add cache
Browse files Browse the repository at this point in the history
  • Loading branch information
Haldir65 committed Jul 5, 2024
1 parent d5daad8 commit 4a0e551
Show file tree
Hide file tree
Showing 2 changed files with 42 additions and 19 deletions.
28 changes: 28 additions & 0 deletions .github/actions/cache-build-dir/action.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
name: 'Cache Build'
description: 'Cache build paths'
inputs:
key:
description: 'Cache key'
required: true
runs:
using: 'composite'
steps:
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.85.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.85.0
- name: Retrieve boost cache
shell: bash
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"

- name: Cache build artifacts
uses: actions/cache@v4
with:
path: |
${GITHUB_WORKSPACE}/ronan/build/_deps
key: ${{ inputs.key }}
restore-keys: |
${{ inputs.key }}
33 changes: 14 additions & 19 deletions .github/workflows/automate_build_of_repo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,17 +54,14 @@ jobs:
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4
with:
path: ronan/cmake/vendor/boost-1.85.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.85.0

- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
- name: Checkout
uses: actions/checkout@v4

- name: Cache Cmake packages
uses: .github/actions/cache-build-dir
with:
key: ${{ runner.os }}-cmake-${{ hashFiles('**/*.cmake*', '**/CMakeLists.txt') }}

- name: Install LLVM and Clang on linux
if: startsWith(matrix.target.id, 'linux-')
uses: KyleMayes/install-llvm-action@v2
Expand Down Expand Up @@ -186,21 +183,19 @@ jobs:
token: ${{ secrets.ACCESS_TOKEN }}
ref: 'master'
path: ronan
- name: Cache Boost artifact
id: cache-boost
uses: actions/cache@v4

- name: Cache Cmake packages
uses: ronan/.github/actions/cache-build-dir
with:
path: ronan/cmake/vendor/boost-1.85.0-cmake.tar.xz
key: ${{ runner.os }}-boost-1.85.0
- name: Retrieve boost cache
if: steps.cache-boost.outputs.cache-hit != 'true'
run: echo "boost cache is not found locally"
key: ${{ runner.os }}-cmake-${{ hashFiles('**/*.cmake*', '**/CMakeLists.txt') }}


- name: install dependency on debian
shell: bash
run: |
apt update
apt install -y sudo ninja-build git unzip build-essential tree checkinstall zlib1g-dev libtbb-dev wget
- name: install latest version of cmake
shell: bash
# if: matrix.container == 'silkeh/clang:17-bookworm' || matrix.container == 'ubuntu:24.04'
Expand Down

0 comments on commit 4a0e551

Please sign in to comment.