Skip to content

Commit

Permalink
[ci] Add gazebo docker build
Browse files Browse the repository at this point in the history
  • Loading branch information
jslee02 committed Apr 4, 2024
1 parent 5ba1e72 commit fe046a2
Show file tree
Hide file tree
Showing 2 changed files with 95 additions and 0 deletions.
60 changes: 60 additions & 0 deletions .github/workflows/ci_downstream.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
# https://help.github.com/en/articles/workflow-syntax-for-github-actions

name: CI Downstream

on:
push:
branches:
- "**"
paths-ignore:
- ".github/workflows/cache_*.yml"
- "docker/dev/**"
pull_request:
branches:
- "**"
paths-ignore:
- ".github/workflows/cache_*.yml"
- "docker/dev/**"
schedule:
# Cron syntax: [minute hour day_of_the_month month day_of_the_week]
- cron: "0 2 * * 0,3" # Run every Sunday and Wednesday at 02:00
workflow_dispatch:

env:
DOCKER_REPO: jslee02/dart-dev # https://hub.docker.com/repository/docker/jslee02/dart-dev

jobs:
tracy:
name: gazebo
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
dart_version: [v6.14]
build_min: [ON]
env:
OS_VERSION: gazebo
DART_VERSION: ${{ matrix.dart_version }}
steps:
# https://github.com/marketplace/actions/docker-setup-qemu
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
# https://github.com/marketplace/actions/docker-setup-buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# https://github.com/marketplace/actions/docker-login
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and push
id: docker_build
uses: docker/build-push-action@v5
with:
file: ./docker/dev/${{ env.DART_VERSION }}/Dockerfile.${{ env.OS_VERSION }}
push: true
tags: ${{ env.DOCKER_REPO }}:${{ env.OS_VERSION }}-${{ env.DART_VERSION }}
- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
35 changes: 35 additions & 0 deletions docker/dev/v6.14/Dockerfile.gazebo
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
# Use an Ubuntu base image
FROM jslee02/dart-dev:ubuntu-jammy-v6.14

# Avoid warnings by switching to noninteractive
ENV DEBIAN_FRONTEND=noninteractive

WORKDIR /ws

# Compile and install DART and dartpy
COPY . /ws/dart
RUN rm -rf /ws/dart/build
RUN cmake \
-S dart \
-B dart/build \
-DCMAKE_INSTALL_PREFIX=/usr/ \
-DCMAKE_BUILD_TYPE=Release .. \
-DBUILD_SHARED_LIBS=ON \
&& cmake \
--build dart/build \
--target install \
-j16

# Install Gazebo from source
ENV IGNITION_PHYSICS_VERSION=7
RUN apt-add-repository -s "deb http://packages.osrfoundation.org/gazebo/ubuntu-stable $(lsb_release -c -s) main"
RUN apt-get build-dep -y ignition-physics${IGNITION_PHYSICS_VERSION}-dev
RUN clone https://github.com/ignitionrobotics/ign-physics -b ign-physics${IGNITION_PHYSICS_VERSION}
RUN cmake \
-S ign-physics \
-B ign-physics/build \
-DCMAKE_BUILD_TYPE=Release .. \
&& cmake \
--build build \
--target install \
-j16

0 comments on commit fe046a2

Please sign in to comment.