diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml new file mode 100644 index 0000000..e386590 --- /dev/null +++ b/.github/workflows/ci.yaml @@ -0,0 +1,48 @@ +name: CI for X17-Surface + +on: + push: + branches: + - main + pull_request: + branches: + - main + +jobs: + build: + runs-on: ubuntu-latest + + steps: + # Check out the repository + - name: Checkout code + uses: actions/checkout@v2 + + # Set up ROS 2 + - name: Set up ROS 2 + run: | + + locale # Set the locale + sudo apt update && sudo apt install locales + sudo locale-gen en_US en_US.UTF-8 + sudo update-locale LC_ALL=en_US.UTF-8 LANG=en_US.UTF-8 + export LANG=en_US.UTF-8 + locale # verify settings + + # Ensure the Ubuntu Universe repository is enabled + sudo apt install software-properties-common + sudo add-apt-repository universe + + # Add the ROS 2 GPG key with apt + sudo apt update && sudo apt install curl -y + sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpg + + # Then add the repository to the sources list + echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://packages.ros.org/ros2/ubuntu $(. /etc/os-release && echo $UBUNTU_CODENAME) main" | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null + + # Install ROS 2 Jazzy + sudo apt update + sudo apt upgrade -y + sudo apt install ros-foxy-desktop + + # Source the ROS 2 setup script + source /opt/ros/jazzy/setup.bash \ No newline at end of file