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

Added commands in CI for building docker images when merged #57

Merged
merged 4 commits into from
Jul 7, 2023
Merged
Show file tree
Hide file tree
Changes from all 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
62 changes: 0 additions & 62 deletions .github/workflows/jammy_build.yml

This file was deleted.

55 changes: 47 additions & 8 deletions .github/workflows/focal_build.yml → .github/workflows/ubuntu.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Focal-Build
name: Ubuntu

on:
push:
Expand All @@ -11,25 +11,31 @@ on:

jobs:
industrial_ci:
name: Foxy
runs-on: ubuntu-20.04
name: ${{ matrix.distro }}
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
distro: [foxy, humble, rolling]
env:
CI_NAME: Focal-Build
CI_NAME: ${{ matrix.distro }}-Build
OS_NAME: ubuntu
OS_CODE_NAME: focal
ROS_DISTRO: foxy
ROS_DISTRO: ${{ matrix.distro }}
ROS_REPO: main
BEFORE_INIT: './.add-gazebo-ppa'
UPSTREAM_WORKSPACE: 'dependencies_unstable.repos'
ROSDEP_SKIP_KEYS: "catkin taskflow fcl gz-common5 gz-math7 gz-rendering7"
ADDITIONAL_DEBS: "libgz-common5-dev libgz-math7-dev libgz-rendering7-dev"
DOCKER_IMAGE: "ros:foxy"
DOCKER_IMAGE: "ros:${{ matrix.distro }}"
PARALLEL_TESTS: false
NOT_TEST_BUILD: true
BEFORE_RUN_TARGET_TEST_EMBED: "source /root/target_ws/install/local_setup.bash"
CCACHE_DIR: "/home/runner/work/tesseract_ros2/tesseract_ros2/Focal-Build/.ccache"
CCACHE_DIR: "/home/runner/work/tesseract_ros2/tesseract_ros2/${{ matrix.distro }}-Build/.ccache"
UPSTREAM_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Release"
TARGET_CMAKE_ARGS: "-DCMAKE_BUILD_TYPE=Debug"
REGISTRY: ghcr.io
IMAGE_NAME: ${{ github.repository }}
PUSH_DOCKER_IMAGE: ${{ github.ref == 'refs/heads/master' || github.event_name == 'release' }}
steps:
- uses: actions/checkout@v1

Expand Down Expand Up @@ -58,5 +64,38 @@ jobs:
restore-keys: |
${{ env.CI_NAME }}-ccache-

- name: Login to Github container registry
uses: docker/login-action@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Extract Docker meta-information
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=false
prefix=
suffix=
tags: |
type=ref,event=branch,prefix=${{ env.ROS_DISTRO }}-
type=semver,pattern={{major}}.{{minor}},prefix=${{ env.ROS_DISTRO }}-

- name: Set build type
run: |
if [[ "${{ env.PUSH_DOCKER_IMAGE }}" = true ]]
then
echo "BUILD_TYPE=Release" >> $GITHUB_ENV
else
echo "BUILD_TYPE=Debug" >> $GITHUB_ENV
fi

- uses: 'ros-industrial/industrial_ci@master'
env: ${{env}}

- name: Push post-build Docker
if: ${{ env.PUSH_DOCKER_IMAGE == 'true' }}
run: docker push ${{ steps.meta.outputs.tags }}