Skip to content

build and test

build and test #104

Workflow file for this run

name: build and test
on:
push:
branches: [ main, develop ]
pull_request:
branches: [ main, develop ]
workflow_dispatch:
schedule:
- cron: '0 0 * * *'
release:
types: [published]
jobs:
build_and_test:
strategy:
matrix:
os:
- ubuntu-22.04
rosdistro:
- humble
runs-on: ubuntu-latest
container:
image: ros:${{ matrix.rosdistro }}-ros-base
steps:
- name: Setup directories
run: mkdir -p ros2_ws/src
- name: Check out repository
uses: actions/checkout@v3
with:
path: ros2_ws/src/arcanain_tutorial
- name: Install dependencies
run: |
rosdep update &&
apt-get update &&
rosdep install --from-path . -i -y --rosdistro ${{ matrix.rosdistro }}
- name: Install diagnostic-updater
run: apt-get install ros-${{ matrix.rosdistro }}-diagnostic-updater
- name: Build tests
id: build_test
run: |
. /opt/ros/${{ matrix.rosdistro }}/setup.sh &&
colcon build
continue-on-error: true
- name: build_test command success
if: steps.build_test.outcome == 'success'
run: echo "result - success"
- name: build_test command failure
if: steps.build_test.outcome == 'failure'
run: echo "result - failure" && exit 1
- name: Run tests
id: run_test
run: |
. /opt/ros/${{ matrix.rosdistro }}/setup.sh &&
colcon test &&
colcon test-result
continue-on-error: true
- name: run_test command success
if: steps.run_test.outcome == 'success'
run: echo "result - success"
- name: run_test command failure
if: steps.run_test.outcome == 'failure'
run: echo "result - failure" && exit 1