workflows on pull request and push for main branch #1
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
name: ROS2 Test Workflow | |
on: | |
push: | |
branches: [ main ] | |
pull_request: | |
branches: [ main ] | |
env: | |
WORKSPACE: "vision_ws" | |
ROS_DISTRO: "foxy" | |
jobs: | |
build-and-test: | |
runs-on: ubuntu-latest | |
container: # TODO : change docker image | |
image: cario360/ros2 | |
steps: | |
- name: Checkout Code | |
uses: actions/checkout@v2 | |
- name: Setup ROS Environment # TODO : check if this is needed | |
run: | | |
echo "source /opt/ros/$ROS_DISTRO/setup.bash" >> ~/.bashrc | |
source ~/.bashrc | |
shell: bash | |
- name: Install Dependencies # TODO : check if this is needed | |
run: | | |
apt-get update | |
apt-get install -y python3-colcon-common-extensions | |
shell: bash | |
- name: Build | |
run: | | |
cd ros2_ws | |
source /opt/ros/$ROS_DISTRO/setup.bash | |
colcon build | |
shell: bash | |
- name: Run Tests | |
run: | | |
source /opt/ros/$ROS_DISTRO/setup.bash | |
cd ros2_ws | |
colcon test | |
colcon test-result --all | |
shell: bash | |
# catkin test $(ls src/pge_packages/) |