From e11bc5b4e0985751c5880950b8f1583a64d5574f Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:36:34 +0200 Subject: [PATCH 1/6] Create Dockerfile --- action-a/Dockerfile | 64 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 64 insertions(+) create mode 100644 action-a/Dockerfile diff --git a/action-a/Dockerfile b/action-a/Dockerfile new file mode 100644 index 0000000..ac0f808 --- /dev/null +++ b/action-a/Dockerfile @@ -0,0 +1,64 @@ +FROM ubuntu:focal + +# Fix locale +RUN apt update && \ + echo 'Etc/UTC' > /etc/timezone && \ + ln -s /usr/share/zoneinfo/Etc/UTC /etc/localtime && \ + apt install -y \ + sudo \ + locales \ + tzdata + +RUN locale-gen en_US.UTF-8; dpkg-reconfigure -f noninteractive locales +ENV LANG en_US.UTF-8 +ENV LANGUAGE en_US.UTF-8 +ENV LC_ALL en_US.UTF-8 + +# nvidia-container-runtime +ENV NVIDIA_VISIBLE_DEVICES \ + ${NVIDIA_VISIBLE_DEVICES:-all} +ENV NVIDIA_DRIVER_CAPABILITIES \ + ${NVIDIA_DRIVER_CAPABILITIES:+$NVIDIA_DRIVER_CAPABILITIES,}graphics + +# Add the ROS apt repository, then install away +RUN sudo apt update +RUN sudo apt install -y \ + curl \ + gnupg2 && \ + sh -c 'curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | apt-key add -' && \ + sh -c 'echo "deb [arch=$(dpkg --print-architecture)] http://packages.ros.org/ros2/ubuntu focal main" > /etc/apt/sources.list.d/ros2-latest.list' && \ + apt update && \ + apt install -y \ + bash-completion \ + build-essential \ + cmake \ + git \ + libbullet-dev \ + python3-colcon-common-extensions \ + python3-flake8 \ + python3-pip \ + python3-pytest-cov \ + python3-rosdep \ + python3-setuptools \ + python3-vcstool \ + wget && \ + apt install --no-install-recommends -y \ + libasio-dev \ + libtinyxml2-dev \ + libcunit1-dev && \ + python3 -m pip install -U \ + argcomplete \ + flake8-blind-except \ + flake8-builtins \ + flake8-class-newline \ + flake8-comprehensions \ + flake8-deprecated \ + flake8-docstrings \ + flake8-import-order \ + flake8-quotes \ + pytest-repeat + +# install Fast-RTPS dependencies +RUN sudo apt install --no-install-recommends -y \ + libasio-dev \ + libtinyxml2-dev From 1c5f9598e64e9c6efb08ba75c6b47ecf3ab02331 Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:39:28 +0200 Subject: [PATCH 2/6] Update Dockerfile --- action-a/Dockerfile | 2 ++ 1 file changed, 2 insertions(+) diff --git a/action-a/Dockerfile b/action-a/Dockerfile index ac0f808..f5871dc 100644 --- a/action-a/Dockerfile +++ b/action-a/Dockerfile @@ -62,3 +62,5 @@ RUN sudo apt install -y \ RUN sudo apt install --no-install-recommends -y \ libasio-dev \ libtinyxml2-dev + +ENTRYPOINT ["/entrypoint.sh"] From a1d6fcd365c50e404d29f3c61a2a2ff923e7ec92 Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:41:08 +0200 Subject: [PATCH 3/6] Create entrypoint.sh --- action-a/entrypoint.sh | 3 +++ 1 file changed, 3 insertions(+) create mode 100644 action-a/entrypoint.sh diff --git a/action-a/entrypoint.sh b/action-a/entrypoint.sh new file mode 100644 index 0000000..7d3abef --- /dev/null +++ b/action-a/entrypoint.sh @@ -0,0 +1,3 @@ +#!/bin/sh -l + +sh -c "echo Hello world my name is $INPUT_MY_NAME" From 0938c5d9842576d90f86f3d0d33ea7b2f00204ff Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:42:29 +0200 Subject: [PATCH 4/6] Create action.yml --- action-a/action.yml | 32 ++++++++++++++++++++++++++++++++ 1 file changed, 32 insertions(+) create mode 100644 action-a/action.yml diff --git a/action-a/action.yml b/action-a/action.yml new file mode 100644 index 0000000..491020e --- /dev/null +++ b/action-a/action.yml @@ -0,0 +1,32 @@ +name: Test Example + +on: + pull_request: + push: + branches: + - master + +jobs: + build-and-test: + runs-on: ${{ matrix.os }} + strategy: + matrix: + os: [ubuntu-latest, windows-latest, macos-latest] + fail-fast: false + steps: + - name: Setup ROS 2 + uses: ros-tooling/setup-ros@0.0.15 + with: + required-ros-distributions: eloquent + + - name: Run Tests + uses: ros-tooling/action-ros-ci@0.0.13 + with: + package-name: example_package + + - name: Upload Logs + uses: actions/upload-artifact@v1 + with: + name: colcon-logs + path: ros_ws/log + if: always() From 03c08085388dbc51b337c1fe952aeed3f4f75d61 Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:55:33 +0200 Subject: [PATCH 5/6] Create main.yml --- .github/workflows/main.yml | 2 ++ 1 file changed, 2 insertions(+) create mode 100644 .github/workflows/main.yml diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..f2809f7 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,2 @@ +name: A workflow for my Hello World file +on: push From 7695bf064d61be269aa82e6f41335e333b7f855e Mon Sep 17 00:00:00 2001 From: smartSRA <82996646+smartSRA@users.noreply.github.com> Date: Fri, 21 May 2021 15:59:04 +0200 Subject: [PATCH 6/6] Update main.yml --- .github/workflows/main.yml | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index f2809f7..ccfec97 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -1,2 +1,12 @@ name: A workflow for my Hello World file on: push + +jobs: + build: + name: Hello world action + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v1 + - uses: ./action-a + with: + MY_NAME: "Mona"