Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Action for a docker based build #7

Open
wants to merge 4 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 30 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
name: Build and test ar3_ros

on:
schedule:
- cron: '07 8 * * *'
pull_request:
branches: [ "main" ]

jobs:
build:

runs-on: ubuntu-latest
permissions:
contents: read

steps:
- name: Checkout repository
uses: actions/checkout@v3

- name: Setup Docker buildx
uses: docker/setup-buildx-action@79abd3f86f79a9d68a23c75a09a9a85889262adf

- name: Build Docker image
id: build
uses: docker/build-push-action@ac9327eae2b366085ac7f6a2d02df8aa8ead720a
with:
context: .
push: false
cache-from: type=gha
cache-to: type=gha,mode=max
31 changes: 31 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
ARG ROS_DISTRO="humble"

FROM docker.io/ros:${ROS_DISTRO}

# Support podman and docker when building locally
# See https://github.com/opencontainers/runc/issues/2517
RUN echo 'APT::Sandbox::User "root";' > /etc/apt/apt.conf.d/sandbox-disable

ENV ROS_OVERLAY /opt/ros/ci

WORKDIR $ROS_OVERLAY

COPY ar3 src/ar3
COPY ar3_bringup src/ar3_bringup
COPY ar3_controllers src/ar3_controllers
COPY ar3_description src/ar3_description
COPY ar3_embedded src/ar3_embedded
COPY ar3_hardware src/ar3_hardware
COPY ar3_hardware_driver src/ar3_hardware_driver
COPY ar3_msgs src/ar3_msgs

RUN apt-get update && \
rosdep install -iy --from-paths src && \
rm -rf /var/lib/apt/lists/

RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
colcon build

RUN . /opt/ros/${ROS_DISTRO}/setup.sh && \
colcon test ; \
colcon test-result --verbose
emanuelbuholzer marked this conversation as resolved.
Show resolved Hide resolved