Skip to content

Commit

Permalink
fix: caching strategies of colcon-build/test and clang-tidy (#304)
Browse files Browse the repository at this point in the history
Signed-off-by: M. Fatih Cırıt <[email protected]>
  • Loading branch information
xmfcx authored Jun 27, 2024
1 parent 92b8188 commit 6c71a4d
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 13 deletions.
8 changes: 6 additions & 2 deletions clang-tidy/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ inputs:
include-eol-distros:
description: ""
required: false
cache-key-element:
description: Will be part of the cache key
default: default
required: false

runs:
using: composite
Expand Down Expand Up @@ -83,12 +87,12 @@ runs:

- name: Restore build files from cache
id: restore-build-files
uses: actions/cache@v4
uses: actions/cache/restore@v4
with:
path: |
./build
./install
key: build-${{ inputs.rosdistro }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cmake-build-type }}-${{ github.sha }}
key: build-${{ runner.arch }}-${{ inputs.rosdistro }}-${{ inputs.cache-key-element }}-${{ inputs.cmake-build-type }}-${{ github.sha }}

- name: Build
if: ${{ steps.restore-build-files.outputs.cache-hit != 'true' }}
Expand Down
8 changes: 6 additions & 2 deletions colcon-build/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,10 @@ inputs:
include-eol-distros:
description: ""
required: false
cache-key-element:
description: Will be part of the cache key
default: default
required: false

runs:
using: composite
Expand Down Expand Up @@ -85,9 +89,9 @@ runs:
shell: bash

- name: Cache build artifacts
uses: actions/cache@v4
uses: actions/cache/save@v4
with:
path: |
./build
./install
key: build-${{ inputs.rosdistro }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cmake-build-type }}-${{ github.sha }}
key: build-${{ runner.arch }}-${{ inputs.rosdistro }}-${{ inputs.cache-key-element }}-${{ inputs.cmake-build-type }}-${{ github.sha }}
9 changes: 0 additions & 9 deletions colcon-test/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -77,15 +77,6 @@ runs:
DEBIAN_FRONTEND=noninteractive rosdep install -yqq --from-paths ${package_paths} --ignore-src --rosdistro ${{ inputs.rosdistro }}
shell: bash

- name: Restore build files from cache
id: restore-build-files
uses: actions/cache@v4
with:
path: |
./build
./install
key: build-${{ inputs.rosdistro }}-${{ runner.os }}-${{ runner.arch }}-${{ inputs.cmake-build-type }}-${{ github.sha }}

- name: Test
run: |
set -e
Expand Down

0 comments on commit 6c71a4d

Please sign in to comment.