ci: correct workflow location #1
This file contains hidden or 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: ROS 2 Launch Tests | |
| on: | |
| push: | |
| branches: [main, testing] | |
| pull_request: | |
| branches: [main, testing] | |
| workflow_dispatch: | |
| jobs: | |
| launch-tests: | |
| runs-on: ubuntu-22.04 | |
| timeout-minutes: 30 | |
| steps: | |
| - uses: actions/checkout@v3 | |
| with: | |
| path: /opt/jderobot | |
| - name: Setup ROS 2 Humble | |
| uses: ros-tooling/setup-ros@v0.6 | |
| with: | |
| required-ros-distributions: humble | |
| - name: Install Gazebo and dependencies | |
| run: | | |
| sudo apt-get update | |
| sudo apt-get install -y python3-pip python3-pytest-timeout python3-pytest-cov \ | |
| ros-humble-launch-testing ros-humble-launch-testing-ament-cmake \ | |
| ros-humble-gazebo-ros-pkgs ros-humble-gazebo-ros ros-humble-xacro \ | |
| ros-humble-joint-state-publisher ros-humble-robot-state-publisher \ | |
| ros-humble-nav2-msgs ros-humble-turtlebot3* | |
| sudo apt-get install -y gazebo libgazebo-dev | |
| # Install any additional dependencies your project needs | |
| - name: Setup Python dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| if [ -f src/RoboticsInfrastructure/test/requirements.txt ]; then | |
| pip install -r src/RoboticsInfrastructure/test/requirements.txt | |
| fi | |
| pip install pytest pytest-timeout pytest-cov | |
| - name: Build workspace | |
| run: | | |
| source /opt/ros/humble/setup.bash | |
| source /usr/share/gazebo/setup.sh | |
| colcon build --symlink-install --packages-up-to custom_robots | |
| - name: Set timeout for launch tests in CMakeLists.txt | |
| run: | | |
| sed -i 's/add_launch_test(${test_file} TIMEOUT 90)/add_launch_test(${test_file} TIMEOUT 180)/g' src/RoboticsInfrastructure/CustomRobots/CMakeLists.txt | |
| # Rebuild with new timeout settings | |
| source /opt/ros/humble/setup.bash | |
| source /usr/share/gazebo/setup.sh | |
| colcon build --symlink-install --packages-select custom_robots | |
| - name: Run launch tests | |
| run: | | |
| source /opt/ros/humble/setup.bash | |
| source /usr/share/gazebo/setup.sh | |
| source install/setup.bash | |
| colcon test --packages-select custom_robots --event-handlers console_direct+ --return-code-on-test-failure | |
| - name: Show test results | |
| if: always() | |
| run: | | |
| colcon test-result --verbose | |
| - name: Upload test logs | |
| if: always() | |
| uses: actions/upload-artifact@v3 | |
| with: | |
| name: test-logs | |
| path: | | |
| log/ | |
| build/custom_robots/test_results/ |