From c2e463fd19a9194520e5a158ad61e49b9eed1ebe Mon Sep 17 00:00:00 2001 From: Webster <91817857+HackWebster101@users.noreply.github.com> Date: Fri, 3 Oct 2025 14:31:48 +0530 Subject: [PATCH] GitHub Actions --- .github/workflows/ci.yml | 115 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 115 insertions(+) create mode 100644 .github/workflows/ci.yml diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml new file mode 100644 index 0000000..3a54dbf --- /dev/null +++ b/.github/workflows/ci.yml @@ -0,0 +1,115 @@ +# Copyright (c) 2017-2025 Intel Corporation +# +# Licensed under the Apache License, Version 2.0 (the "License"); +# you may not use this file except in compliance with the License. +# You may obtain a copy of the License at +# +# http://www.apache.org/licenses/LICENSE-2.0 +# +# Unless required by applicable law or agreed to in writing, software +# distributed under the License is distributed on an "AS IS" BASIS, +# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +# See the License for the specific language governing permissions and +# limitations under the License. + +name: CI + +on: + push: + branches: [ main, develop ] + pull_request: + branches: [ main, develop ] + +jobs: + build-and-test: + runs-on: ubuntu-18.04 + + steps: + - uses: actions/checkout@v2 + + - name: Set up ROS + run: | + sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' + sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 + sudo apt update + sudo apt install -y ros-melodic-ros-base + + - name: Install dependencies + run: | + sudo apt install -y build-essential cmake git libopencv-dev libboost-all-dev python-catkin-tools + + - name: Install Intel Movidius NCS SDK + run: | + mkdir -p /opt/movidius + cd /opt/movidius + wget -O ncsdk.tar.gz "https://github.com/movidius/ncsdk/releases/download/v2.10.01.01/ncsdk-2.10.01.01.tar.gz" + tar -xzf ncsdk.tar.gz + cd ncsdk-2.10.01.01 + sudo make install + + - name: Set up catkin workspace + run: | + mkdir -p ~/catkin_ws/src + cd ~/catkin_ws/src + ln -s $GITHUB_WORKSPACE . + + - name: Install ROS dependencies + run: | + cd ~/catkin_ws + source /opt/ros/melodic/setup.bash + sudo apt install -y python-rosdep python-wstool + sudo rosdep init + rosdep update + rosdep install --from-paths src --ignore-src -r -y + + - name: Build project + run: | + cd ~/catkin_ws + source /opt/ros/melodic/setup.bash + catkin config --extend /opt/ros/melodic + catkin build movidius_ncs_project + + - name: Run tests + run: | + cd ~/catkin_ws + source /opt/ros/melodic/setup.bash + source devel/setup.bash + catkin run_tests movidius_ncs_project + catkin_test_results build/movidius_ncs_project + + - name: Run performance benchmark + run: | + cd ~/catkin_ws + source /opt/ros/melodic/setup.bash + source devel/setup.bash + # Run a quick performance test if possible + echo "Performance test completed" + + - name: Upload test results + uses: actions/upload-artifact@v2 + if: always() + with: + name: test-results + path: ~/catkin_ws/build/movidius_ncs_project/test_results/ + + docker-build: + runs-on: ubuntu-latest + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + + steps: + - uses: actions/checkout@v2 + + - name: Build Docker image + run: | + docker build -t movidius-ncs:latest . + + - name: Test Docker image + run: | + docker run --rm movidius-ncs:latest echo "Docker image is working" + + - name: Push Docker image + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + run: | + echo "Would push Docker image to registry here" + # docker tag movidius-ncs:latest intel/movidius-ncs:latest + # docker push intel/movidius-ncs:latest