Skip to content

Commit

Permalink
(actions) migrate back actions/cache@v4 (#2700)
Browse files Browse the repository at this point in the history
Which now also supports save-always, but is maintained much better.
See pat-s/always-upload-cache#2
  • Loading branch information
MatthijsBurgh authored Feb 21, 2024
1 parent f47b4c0 commit 6b28fcf
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 5 deletions.
9 changes: 6 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,35 @@ jobs:
with:
file: moveit2.repos
- name: Cache upstream workspace
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/upstream_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ${{ steps.rosdistro_release_date.outputs.date }}-upstream_ws-${{ steps.repos_edit_timestamp.outputs.timestamp }}-${{ matrix.env.IMAGE }}-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
# The target directory cache doesn't include the source directory because
# that comes from the checkout. See "prepare target_ws for cache" task below
- name: Cache target workspace
if: "!matrix.env.CCOV"
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/target_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: target_ws${{ matrix.env.CCOV && '-ccov' || '' }}-${{ matrix.env.IMAGE }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml', '.github/workflows/ci.yaml') }}
- name: Cache ccache
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
${{ env.CACHE_PREFIX }}-${{ github.sha }}
${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ccache-${{ matrix.env.IMAGE }}${{ matrix.env.CCOV && '-ccov' || '' }}
- name: Configure ccache
Expand Down
6 changes: 4 additions & 2 deletions .github/workflows/sonar.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -71,21 +71,23 @@ jobs:
with:
file: moveit2.repos
- name: Cache upstream workspace
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.BASEDIR }}/upstream_ws
key: ${{ env.CACHE_PREFIX }}-${{ github.run_id }}
restore-keys: ${{ env.CACHE_PREFIX }}
save-always: true
env:
CACHE_PREFIX: ${{ steps.rosdistro_release_date.outputs.date }}-upstream_ws-${{ steps.repos_edit_timestamp.outputs.timestamp }}-rolling-ci-${{ hashFiles('moveit2*.repos', '.github/workflows/ci.yaml') }}
- name: Cache ccache
uses: pat-s/always-upload-cache@v3.0.11
uses: actions/cache@v4
with:
path: ${{ env.CCACHE_DIR }}
key: ccache-rolling-ci-ccov-${{ github.sha }}-${{ github.run_id }}
restore-keys: |
ccache-rolling-ci-ccov-${{ github.sha }}
ccache-rolling-ci-ccov
save-always: true
- name: Configure ccache
run: |
mkdir -p ${{ env.CCACHE_DIR }}
Expand Down

0 comments on commit 6b28fcf

Please sign in to comment.