Skip to content

Commit f8c6db6

Browse files
ICI: Use gh action for caching (#392)
1 parent d287eb9 commit f8c6db6

8 files changed

Lines changed: 62 additions & 11 deletions

.github/workflows/humble-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/humble-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.humble.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/humble-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.humble.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/jazzy-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/jazzy-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.jazzy.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/jazzy-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.jazzy.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/kilted-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/kilted-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.kilted.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/kilted-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.kilted.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/reusable-industrial-ci-with-cache.yml

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -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

.github/workflows/rolling-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/rolling-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.rolling.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/rolling-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.rolling.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/rolling-compatibility-humble-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/rolling-compatibility-humble-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.rolling-on-humble.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/rolling-compatibility-humble-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.rolling-on-humble.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/rolling-compatibility-jazzy-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/rolling-compatibility-jazzy-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.rolling-on-jazzy.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/rolling-compatibility-jazzy-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.rolling-on-jazzy.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

.github/workflows/rolling-compatibility-kilted-binary-build.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,13 @@ on:
99
- '.github/workflows/rolling-compatibility-kilted-binary-build.yml'
1010
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
1111
- 'ros_controls.rolling-on-kilted.repos'
12+
push:
13+
branches:
14+
- master
15+
paths:
16+
- '.github/workflows/rolling-compatibility-kilted-binary-build.yml'
17+
- '.github/workflows/reusable-industrial-ci-with-cache.yml'
18+
- 'ros_controls.rolling-on-kilted.repos'
1219
schedule:
1320
# Run every morning to detect flakiness and broken dependencies
1421
- cron: '03 1 * * *'

0 commit comments

Comments
 (0)