diff --git a/.devcontainer/jazzy/Dockerfile b/.devcontainer/jazzy/Dockerfile new file mode 100644 index 0000000..5b9963f --- /dev/null +++ b/.devcontainer/jazzy/Dockerfile @@ -0,0 +1,26 @@ +FROM ros:jazzy-ros-base + +# Add vscode user with same UID and GID as your host system +# (copied from https://code.visualstudio.com/remote/advancedcontainers/add-nonroot-user#_creating-a-nonroot-user) +ARG USERNAME=ubuntu +RUN apt-get update \ + && apt-get install -y sudo \ + && echo $USERNAME ALL=\(root\) NOPASSWD:ALL > /etc/sudoers.d/$USERNAME \ + && chmod 0440 /etc/sudoers.d/$USERNAME +# Switch from root to user +USER $USERNAME + +# Add user to video group to allow access to webcam +RUN sudo usermod --append --groups video $USERNAME + +# Update all packages +RUN sudo apt update && sudo apt upgrade -y + +# Install Git +RUN sudo apt install -y git + +# Rosdep update +RUN rosdep update + +# Source the ROS setup file +RUN echo "source /opt/ros/${ROS_DISTRO}/setup.bash" >> ~/.bashrc diff --git a/.devcontainer/jazzy/devcontainer.json b/.devcontainer/jazzy/devcontainer.json new file mode 100644 index 0000000..f701931 --- /dev/null +++ b/.devcontainer/jazzy/devcontainer.json @@ -0,0 +1,19 @@ +{ + "name": "jazzy", + "dockerFile": "Dockerfile", + "runArgs": [ + "--privileged", + "--network=host" + ], + "workspaceMount": "source=${localWorkspaceFolder},target=/${localWorkspaceFolderBasename},type=bind", + "workspaceFolder": "/${localWorkspaceFolderBasename}", + "mounts": [], + "customizations": { + "vscode": { + "extensions": [ + "ms-vscode.cpptools", + "eamodio.gitlens" + ] + } + } +} \ No newline at end of file diff --git a/.github/workflows/ros-build-test.yaml b/.github/workflows/ros-build-test.yaml index 4321d99..3d4ca12 100644 --- a/.github/workflows/ros-build-test.yaml +++ b/.github/workflows/ros-build-test.yaml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - ros-version: [humble, iron] + ros-version: [humble, iron, jazzy] steps: - name: Check out code @@ -40,7 +40,8 @@ jobs: - name: Adjust permissions run: | - docker run -v ${{ github.workspace }}:/workspace -w /workspace local:${{ matrix.ros-version }} sudo chown -R vscode:vscode /workspace + docker run -v ${{ github.workspace }}:/workspace -w /workspace local:${{ matrix.ros-version }} \ + sh -c 'username=$(id -un) && sudo chown -R "$username":"$username" /workspace' - name: Run colcon build run: |