Backport of Use venv in CI (#916) to humble #2237
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# This config uses industrial_ci (https://github.com/ros-industrial/industrial_ci.git). | |
# For troubleshooting, see readme (https://github.com/ros-industrial/industrial_ci/blob/master/README.rst) | |
name: CI | |
on: | |
schedule: | |
# 5 PM UTC every Sunday | |
- cron: '0 17 * * 6' | |
workflow_dispatch: | |
pull_request: | |
branches: | |
- humble | |
push: | |
branches: | |
- humble | |
jobs: | |
default: | |
strategy: | |
matrix: | |
env: | |
- IMAGE: humble-source | |
- IMAGE: humble-release | |
env: | |
DOCKER_IMAGE: moveit/moveit2:${{ matrix.env.IMAGE }} | |
UPSTREAM_WORKSPACE: .github/upstream.repos | |
AFTER_SETUP_UPSTREAM_WORKSPACE: vcs pull $BASEDIR/upstream_ws/src | |
TARGET_CMAKE_ARGS: -DCMAKE_BUILD_TYPE=Release | |
CCACHE_DIR: ${{ github.workspace }}/.ccache | |
BASEDIR: ${{ github.workspace }}/.work | |
CACHE_PREFIX: ${{ matrix.env.IMAGE }} | |
AFTER_INIT: git config --global --add safe.directory "*" | |
name: ${{ matrix.env.IMAGE }} | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
with: | |
fetch-depth: 0 | |
- name: cache upstream_ws | |
uses: pat-s/always-upload-cache@v3.0.11 | |
with: | |
path: ${{ env.BASEDIR }}/upstream_ws | |
key: upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('.github/upstream.repos') }}-${{ github.run_id }} | |
restore-keys: | | |
upstream_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('.github/upstream.repos') }} | |
# 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_ws | |
uses: pat-s/always-upload-cache@v3.0.11 | |
with: | |
path: ${{ env.BASEDIR }}/target_ws | |
key: target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }}-${{ github.run_id }} | |
restore-keys: | | |
target_ws-${{ env.CACHE_PREFIX }}-${{ hashFiles('**/CMakeLists.txt', '**/package.xml') }} | |
- name: cache ccache | |
uses: pat-s/always-upload-cache@v3.0.11 | |
with: | |
path: ${{ env.CCACHE_DIR }} | |
key: ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }}-${{ github.run_id }} | |
restore-keys: | | |
ccache-${{ env.CACHE_PREFIX }}-${{ github.sha }} | |
ccache-${{ env.CACHE_PREFIX }} | |
- name: industrial_ci | |
uses: ros-industrial/industrial_ci@master | |
env: ${{ matrix.env }} | |
- name: prepare target_ws for cache | |
run: | | |
du -sh ${{ env.BASEDIR }}/target_ws | |
sudo find ${{ env.BASEDIR }}/target_ws -wholename '*/test_results/*' -delete | |
sudo rm -rf ${{ env.BASEDIR }}/target_ws/src | |
du -sh ${{ env.BASEDIR }}/target_ws |