Skip to content

CI fixes

CI fixes #49

Workflow file for this run

name: Test
on:
pull_request:
branches: [master]
push:
branches: [master]
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
pre-commit:
name: Run pre-commit hooks
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with: { python-version: "3.10" }
- uses: pre-commit/action@v3.0.1
extract-image:
name: Get image version
runs-on: ubuntu-latest
outputs:
image-url: ${{ steps.extractor.outputs.image_url }}
steps:
- uses: actions/checkout@v4
- name: Extract image URL
id: extractor
run: |
IMAGE_URL=$(grep -o 'image:\s*[^ ]*' docker-compose.yaml | cut -d ' ' -f2)
echo "image_url=$IMAGE_URL" | tee -a $GITHUB_OUTPUT
build-and-check:
name: Build, test, lint
needs: extract-image
runs-on: self-hosted
container:
image: ${{ needs.extract-image.outputs.image-url }}
defaults:
run: { shell: bash }
steps:
- uses: actions/checkout@v4
- name: Build ROS2 packages
run: |
cd $GITHUB_WORKSPACE
make build-all CMAKE_TOOLS_ADDRESS_SANITIZER="-fsanitize=address"
source install/setup.bash
- name: Test ROS2 packages
continue-on-error: true
run: make test-all
- name: Run Clang-Tidy
run: |
make lint-all
git diff
- name: Check previous steps
if: ${{ failure() }}
run: exit 1