Skip to content

CI pipeline

CI pipeline #2

Workflow file for this run

name: ROS2 CI
on:
pull_request:
branches: [ "master" ]
types: [ opened, reopened, ready_for_review, synchronize ]
jobs:
extract-image:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Extract image URL
run: |
IMAGE_URL=$(grep -o 'image:\s*[^ ]*' docker-compose.yaml | cut -d' ' -f2)
echo "::set-output name=image_url::$IMAGE_URL"
- name: Print Image URL
run: echo ${{ steps.extract-image.outputs.image_url }}
build-and-check:
env:
check_changed_only: true
runs-on: ubuntu-20.04
container:
image: ${{ needs.extract-image.outputs.image_url }}
volumes:
- "/handy:/handy"
options: -w /handy
steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v2
with:
python-version: 3.8
- name: Build ROS2 packages
run: |
source /opt/ros/iron/setup.bash;
cd packages;
mkdir -p camera/params;
colcon build --merge-install --cmake-args -DCMAKE_EXPORT_COMPILE_COMMANDS=1 -DCMAKE_TOOLS_ADDRESS_SANITIZER=1;
source install/setup.bash
- name: Test ROS2 packages
run: |
pwd
ls
colcon test --ctest-args tests --merge-install --executor parallel --parallel-workers 8 --return-code-on-test-failure
- name: Fetch base branch
run: git fetch origin ${{ github.event.pull_request.base.ref }}:${{ github.event.pull_request.base.ref }};
- name: Launching pre-commit
uses: pre-commit/[email protected]
with:
extra_args: --from-ref ${{ github.event.pull_request.base.sha }} --to-ref ${{ github.sha }}