diff --git a/clang-tidy/action.yaml b/clang-tidy/action.yaml index be96e559..a7baab0a 100644 --- a/clang-tidy/action.yaml +++ b/clang-tidy/action.yaml @@ -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 @@ -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' }} diff --git a/colcon-build/action.yaml b/colcon-build/action.yaml index 84e1cbbd..49b7e1c3 100644 --- a/colcon-build/action.yaml +++ b/colcon-build/action.yaml @@ -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 @@ -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 }} diff --git a/colcon-test/action.yaml b/colcon-test/action.yaml index 7e005778..d7517ada 100644 --- a/colcon-test/action.yaml +++ b/colcon-test/action.yaml @@ -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