Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Speed up CI using compiler cache #78

Closed
wants to merge 7 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/scripts/ccache_with_fix.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/bash

BASEDIR=$(ls -d /__w/beluga/beluga/ros_ws/src/??????????? | head -n 1)

echo "Using CCACHE_BASEDIR=$BASEDIR"

exec \
env VERBOSE=1 \
env CCACHE_BASEDIR=$BASEDIR \
ccache $@
22 changes: 20 additions & 2 deletions .github/workflows/ci_pipeline.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ jobs:
runs-on: ubuntu-22.04
env:
ROS_DISTRO: humble
CCACHE_DEBUG: true
container:
image: ros:humble-ros-base-jammy
steps:
Expand All @@ -25,23 +26,40 @@ jobs:
- name: Install python packages
run: pip install colcon-lcov-result==0.5.0 pre-commit==2.20.0

- name: Cache
uses: Chocobo1/setup-ccache-action@v1
with:
api_token: ${{ secrets.GITHUB_TOKEN }}
update_packager_index: false
remove_stale_cache: false

- name: Build and test
uses: ros-tooling/action-ros-ci@0.2.7
with:
package-name: beluga beluga_amcl
target-ros2-distro: ${{ env.ROS_DISTRO }}
target-ros2-distro: ${{ env.ROS_DISTRO }}
import-token: ${{ secrets.GITHUB_TOKEN }}
colcon-defaults: |
{
"build": {
"mixin": ["coverage-gcc", "coverage-pytest"]
"mixin": ["coverage-gcc", "coverage-pytest"],
"cmake-args": [
"-DCMAKE_C_COMPILER_LAUNCHER=/__w/beluga/beluga/.github/scripts/ccache_with_fix.sh",
"-DCMAKE_CXX_COMPILER_LAUNCHER=/__w/beluga/beluga/.github/scripts/ccache_with_fix.sh"
]
},
"test": {
"mixin": ["coverage-pytest"]
}
}
colcon-mixin-repository: https://raw.githubusercontent.com/colcon/colcon-mixin-repository/c75e4b34a3959524564afb584e2aa33c7eec323c/index.yaml

- name: Upload cache as artifact
uses: actions/upload-artifact@v3
with:
name: ccache
path: /github/home/.cache/ccache

- name: Lint
shell: bash
run: |
Expand Down