diff --git a/.github/workflows/sphinx-docs.yml b/.github/workflows/sphinx-docs.yml index c5d03af3..161893e6 100644 --- a/.github/workflows/sphinx-docs.yml +++ b/.github/workflows/sphinx-docs.yml @@ -1,10 +1,23 @@ name: Build and Deploy Sphinx Docs on: + workflow_dispatch: push: branches: [main] + paths: + - ".github/workflows/sphinx-docs.yml" + - "README.md" + - "docs/**" + - "client/python/projectairsim/docs/**" + - "client/python/projectairsim/src/**" pull_request: branches: [main] + paths: + - ".github/workflows/sphinx-docs.yml" + - "README.md" + - "docs/**" + - "client/python/projectairsim/docs/**" + - "client/python/projectairsim/src/**" jobs: build-docs: diff --git a/.github/workflows/test_cpp_client.yml b/.github/workflows/test_cpp_client.yml index a6df67ed..a37f1ec8 100644 --- a/.github/workflows/test_cpp_client.yml +++ b/.github/workflows/test_cpp_client.yml @@ -1,4 +1,4 @@ -name: C++ Client Build and Package +name: C++ Client and ROS 2 C++ Node CI "on": workflow_dispatch: @@ -8,27 +8,56 @@ name: C++ Client Build and Package paths: - ".github/workflows/test_cpp_client.yml" - "client/cpp/**" - - "build.cmd" - - "build.sh" - - "build_windows.mk" - - "build_linux.mk" + - "client/python/example_user_scripts/sim_config/**" + - "core_sim/**" + - "ros/projectairsim_ros2_cpp/**" push: branches: - main paths: - ".github/workflows/test_cpp_client.yml" - "client/cpp/**" - - "build.cmd" - - "build.sh" - - "build_windows.mk" - - "build_linux.mk" + - "client/python/example_user_scripts/sim_config/**" + - "core_sim/**" + - "ros/projectairsim_ros2_cpp/**" permissions: contents: read + pull-requests: read jobs: + changes: + name: Detect changed components + runs-on: ubuntu-22.04 + outputs: + client: ${{ steps.filter.outputs.client }} + ros2: ${{ steps.filter.outputs.ros2 }} + + steps: + - uses: actions/checkout@v4 + + - name: Detect relevant changes + id: filter + if: github.event_name != 'workflow_dispatch' + uses: dorny/paths-filter@v3 + with: + filters: | + client: + - '.github/workflows/test_cpp_client.yml' + - 'client/cpp/**' + - 'client/python/example_user_scripts/sim_config/**' + - 'core_sim/**' + ros2: + - '.github/workflows/test_cpp_client.yml' + - 'ros/projectairsim_ros2_cpp/**' + - 'client/cpp/**' + - 'client/python/example_user_scripts/sim_config/**' + - 'core_sim/**' + windows: name: Windows package + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.client == 'true' runs-on: windows-2022 timeout-minutes: 90 @@ -137,6 +166,8 @@ jobs: linux: name: Linux package (${{ matrix.os }}) + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.client == 'true' runs-on: ${{ matrix.os }} timeout-minutes: 90 @@ -255,3 +286,50 @@ jobs: packages/projectairsim_cpp_client/ProjectAirSimCppClient-*-linux64.tar.gz packages/projectairsim_cpp_client/ProjectAirSimCppClient-*-linux64.tar.gz.sha256 if-no-files-found: error + + ros2-humble: + name: ROS 2 Humble node build and unit tests + needs: changes + if: github.event_name == 'workflow_dispatch' || needs.changes.outputs.ros2 == 'true' + runs-on: ubuntu-22.04 + timeout-minutes: 45 + + steps: + - uses: actions/checkout@v4 + + - name: Set up ROS 2 Humble + uses: ros-tooling/setup-ros@v0.7 + with: + required-ros-distributions: humble + + - name: Install package dependencies + shell: bash + run: | + rosdep update + rosdep install \ + --from-paths ros/projectairsim_ros2_cpp \ + --ignore-src \ + --rosdistro humble \ + -y + + - name: Build node + shell: bash + run: | + source /opt/ros/humble/setup.bash + colcon build \ + --base-paths ros \ + --packages-select projectairsim_ros2_cpp \ + --cmake-args -DBUILD_TESTING=ON \ + --event-handlers console_direct+ + + - name: Run unit tests + shell: bash + run: | + source /opt/ros/humble/setup.bash + source install/setup.bash + colcon test \ + --base-paths ros \ + --packages-select projectairsim_ros2_cpp \ + --return-code-on-test-failure \ + --event-handlers console_direct+ + colcon test-result --test-result-base build --verbose diff --git a/.github/workflows/test_linux_simlibs_debug.yml b/.github/workflows/test_linux_simlibs_debug.yml deleted file mode 100644 index b57e193f..00000000 --- a/.github/workflows/test_linux_simlibs_debug.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Linux SimLibs Debug Tests - -on: - pull_request: - branches: - - main - push: - branches: - - main - -jobs: - test-simlibs-debug: - runs-on: ubuntu-24.04 - timeout-minutes: 180 - - steps: - - uses: actions/checkout@v4 - - - name: Install Linux Prerequisites - shell: bash - run: | - sudo apt-get update - sudo apt-get -y install --no-install-recommends \ - build-essential rsync make cmake \ - clang-18 libc++-18-dev libc++abi-18-dev \ - ninja-build libvulkan1 vulkan-tools \ - libeigen3-dev - - - name: Configure Clang Compatibility - shell: bash - run: | - sudo ln -sf /usr/bin/clang-18 /usr/bin/clang-13 - sudo ln -sf /usr/bin/clang++-18 /usr/bin/clang++-13 - - - name: Build SimLibs - shell: bash - run: | - chmod +x ./build.sh - ./build.sh simlibs_release - - - name: Test SimLibs - shell: bash - run: | - ./build.sh test_simlibs_release diff --git a/.github/workflows/test_linux_simlibs_release.yml b/.github/workflows/test_linux_simlibs_release.yml new file mode 100644 index 00000000..0406f159 --- /dev/null +++ b/.github/workflows/test_linux_simlibs_release.yml @@ -0,0 +1,67 @@ +name: Linux SimLibs Release Tests + +on: + workflow_dispatch: + pull_request: + branches: + - main + paths: + - ".github/workflows/test_linux_simlibs_release.yml" + - "CMakeLists.txt" + - "build.cmd" + - "build.sh" + - "build_linux.mk" + - "setup_linux_dev_tools.sh" + - "core_sim/**" + - "mavlinkcom/**" + - "physics/**" + - "rendering/**" + - "samples/**" + - "simserver/**" + - "tools/**" + - "unity/**" + - "vehicle_apis/**" + push: + branches: + - main + paths: + - ".github/workflows/test_linux_simlibs_release.yml" + - "CMakeLists.txt" + - "build.cmd" + - "build.sh" + - "build_linux.mk" + - "setup_linux_dev_tools.sh" + - "core_sim/**" + - "mavlinkcom/**" + - "physics/**" + - "rendering/**" + - "samples/**" + - "simserver/**" + - "tools/**" + - "unity/**" + - "vehicle_apis/**" + +jobs: + test-simlibs-release: + runs-on: ubuntu-22.04 + timeout-minutes: 180 + + steps: + - uses: actions/checkout@v4 + + - name: Set up Linux development tools + shell: bash + run: | + chmod +x ./setup_linux_dev_tools.sh + ./setup_linux_dev_tools.sh + + - name: Build SimLibs + shell: bash + run: | + chmod +x ./build.sh + ./build.sh simlibs_release + + - name: Test SimLibs + shell: bash + run: | + ./build.sh test_simlibs_release diff --git a/.github/workflows/test_on_self_hosted.yml b/.github/workflows/test_on_self_hosted.yml index e3865fa3..40be4432 100644 --- a/.github/workflows/test_on_self_hosted.yml +++ b/.github/workflows/test_on_self_hosted.yml @@ -4,6 +4,24 @@ on: pull_request: branches: - main + paths: + - ".github/workflows/test_on_self_hosted.yml" + - "CMakeLists.txt" + - "build.sh" + - "build_linux.mk" + - "setup_linux_dev_tools.sh" + - "unreal-linux-toolchain.cmake" + - "client/python/**" + - "core_sim/**" + - "mavlinkcom/**" + - "physics/**" + - "rendering/**" + - "samples/**" + - "simserver/**" + - "tools/**" + - "unity/**" + - "unreal/**" + - "vehicle_apis/**" # Only run when the self-hosted label is added; the job itself still # rejects draft PRs and PRs without run-self-hosted. types: [labeled] diff --git a/.github/workflows/test_windows.yml b/.github/workflows/test_windows.yml index 698b9bc7..2734a1b2 100644 --- a/.github/workflows/test_windows.yml +++ b/.github/workflows/test_windows.yml @@ -2,12 +2,41 @@ name: Windows Build and Tests # Controls when the action will run. on: + workflow_dispatch: pull_request: branches: - main + paths: + - ".github/workflows/test_windows.yml" + - "CMakeLists.txt" + - "build.cmd" + - "build_windows.mk" + - "core_sim/**" + - "mavlinkcom/**" + - "physics/**" + - "rendering/**" + - "samples/**" + - "simserver/**" + - "tools/**" + - "unity/**" + - "vehicle_apis/**" push: branches: - main + paths: + - ".github/workflows/test_windows.yml" + - "CMakeLists.txt" + - "build.cmd" + - "build_windows.mk" + - "core_sim/**" + - "mavlinkcom/**" + - "physics/**" + - "rendering/**" + - "samples/**" + - "simserver/**" + - "tools/**" + - "unity/**" + - "vehicle_apis/**" jobs: build: @@ -31,4 +60,4 @@ jobs: - name: Run SimLibs Debug Tests shell: cmd - run: build test_simlibs_debug \ No newline at end of file + run: build test_simlibs_debug