@@ -88,16 +88,16 @@ jobs:
8888 BASEDIR : ${{ github.workspace }}/${{ inputs.basedir }}
8989 CACHE_PREFIX : ${{ inputs.ros_distro }}-${{ inputs.upstream_workspace }}-${{ inputs.ros_repo }}-${{ github.job }}
9090 steps :
91- - name : Checkout ${{ inputs .ref }} when build is not scheduled
91+ - name : Checkout ${{ github .ref }} when build is not scheduled
9292 if : ${{ github.event_name != 'schedule' }}
9393 uses : actions/checkout@v4
94- - name : Checkout ${{ inputs.ref }} on scheduled build
94+ - name : Checkout ${{ inputs.ref_for_scheduled_build }} on scheduled build
9595 if : ${{ github.event_name == 'schedule' }}
9696 uses : actions/checkout@v4
9797 with :
9898 ref : ${{ inputs.ref_for_scheduled_build }}
99- - name : cache ccache
100- uses : pat-s/always-upload- cache@v3.0.11
99+ - name : Restore ccache folder
100+ uses : actions/ cache/restore@v4
101101 with :
102102 path : ${{ env.CCACHE_DIR }}
103103 key : ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
@@ -128,10 +128,19 @@ jobs:
128128 CXX : ${{ inputs.cxx_compiler }}
129129 CMAKE_ARGS : -DCMAKE_CXX_FLAGS="-isystem /opt/ros/${{ inputs.ros_distro }}/include"
130130 id : ici
131+ - name : Save ccache folder
132+ uses : actions/cache/save@v4
133+ # save if build step succeeded, but only on default branch to save disk space
134+ if : ${{ always() && github.ref == format('refs/heads/{0}', github.event.repository.default_branch) && steps.ici.outputs.build_target_workspace == '0' }}
135+ with :
136+ path : ${{ env.CCACHE_DIR }}
137+ key : ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }}
138+
131139 - name : Download issue template for target failure # Has to be a local file
132140 if : ${{ always() && steps.ici.outcome == 'failure' && github.event_name == 'schedule' }}
133141 run :
134142 wget https://raw.githubusercontent.com/ros-controls/ros2_control_ci/master/.github/issue_template_failed_ci.md -O .github/issue_template_failed_ci.md
143+
135144 - name : Download issue template for downstream failure # Has to be a local file
136145 if : ${{ always() && steps.ici.outcome == 'failure' && github.event_name == 'schedule' }}
137146 run :
@@ -158,10 +167,3 @@ jobs:
158167 with :
159168 update_existing : true
160169 filename : .github/issue_template_failed_ci_downstream.md
161- - name : prepare target_ws for cache
162- if : ${{ always() && ! matrix.env.CCOV }}
163- run : |
164- du -sh ${{ env.BASEDIR }}/target_ws
165- sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete
166- sudo rm -rf ${{ env.BASEDIR }}/target_ws/src
167- du -sh ${{ env.BASEDIR }}/target_ws
0 commit comments