Skip to content

Commit 9f70287

Browse files
committed
Add ccache for ici flow
1 parent 51e1356 commit 9f70287

File tree

1 file changed

+15
-0
lines changed

1 file changed

+15
-0
lines changed

.github/workflows/reusable_ici.yml

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -28,13 +28,20 @@ on:
2828
default: ''
2929
required: false
3030
type: string
31+
ccache_dir:
32+
description: 'CCache dir that should be used. Relative to github.workspace'
33+
default: '.ccache'
34+
required: false
35+
type: string
3136

3237
jobs:
3338
reusable_ici:
3439
name: ${{ inputs.ros_distro }} ${{ inputs.ros_repo }}
3540
runs-on: ubuntu-latest
3641
env:
3742
DOCKER_RUN_OPTS: '-v /var/run/docker.sock:/var/run/docker.sock --network ursim_net'
43+
CCACHE_DIR: ${{ github.workspace }}/${{ inputs.ccache_dir }}
44+
CACHE_PREFIX: ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }}
3845
steps:
3946
- name: Checkout ${{ github.ref_name }} since build is not scheduled
4047
if: ${{ github.event_name != 'schedule' }}
@@ -46,6 +53,14 @@ jobs:
4653
ref: ${{ inputs.ref_for_scheduled_build }}
4754
- run: docker network create --subnet=192.168.56.0/24 ursim_net
4855
if: ${{ !env.ACT }}
56+
- name: Cache ccache
57+
uses: actions/cache@v4
58+
with:
59+
path: ${{ env.CCACHE_DIR }}
60+
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
61+
restore-keys: |
62+
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}
63+
ccache-${{ env.CACHE_PREFIX }}
4964
- uses: 'ros-industrial/industrial_ci@master'
5065
env:
5166
UPSTREAM_WORKSPACE: ${{ inputs.upstream_workspace }}

0 commit comments

Comments
 (0)