-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
support github workflows with rolling distro. (#15)
* support github workflows with rolling distro. Signed-off-by: Tomoya.Fujita <[email protected]> * add iron and humble for github/workflows. Signed-off-by: Tomoya.Fujita <[email protected]> --------- Signed-off-by: Tomoya.Fujita <[email protected]>
- Loading branch information
1 parent
5905a1d
commit 8f11b3f
Showing
4 changed files
with
181 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This is workflow for humble distribution | ||
name: humble | ||
|
||
# Currently ros2ai supports all distribution with rolling branch, this is intentionally done. | ||
# Unless it becomes necessary, we will keep the rolling branch for every distribution. | ||
# So that we do not have, dependencies, backport, these maintenance extra cost. | ||
on: | ||
push: | ||
branches: [ "rolling" ] | ||
pull_request: | ||
branches: [ "rolling" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
# each job goes for each ros supported distribution. | ||
# each job description absorb the distribution dependency as much as possible, | ||
# so that build verification script can be agnostic from distribution dependency. | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ros:humble | ||
env: | ||
ROS_DISTRO: humble | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Build with ROS humble | ||
shell: bash | ||
run: | | ||
./scripts/verification.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This is workflow for iron distribution | ||
name: iron | ||
|
||
# Currently ros2ai supports all distribution with rolling branch, this is intentionally done. | ||
# Unless it becomes necessary, we will keep the rolling branch for every distribution. | ||
# So that we do not have, dependencies, backport, these maintenance extra cost. | ||
on: | ||
push: | ||
branches: [ "rolling" ] | ||
pull_request: | ||
branches: [ "rolling" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
# each job goes for each ros supported distribution. | ||
# each job description absorb the distribution dependency as much as possible, | ||
# so that build verification script can be agnostic from distribution dependency. | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ros:iron | ||
env: | ||
ROS_DISTRO: iron | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Build with ROS iron | ||
shell: bash | ||
run: | | ||
./scripts/verification.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,35 @@ | ||
# This is workflow for rolling distribution | ||
name: rolling | ||
|
||
# Currently ros2ai supports all distribution with rolling branch, this is intentionally done. | ||
# Unless it becomes necessary, we will keep the rolling branch for every distribution. | ||
# So that we do not have, dependencies, backport, these maintenance extra cost. | ||
on: | ||
push: | ||
branches: [ "rolling" ] | ||
pull_request: | ||
branches: [ "rolling" ] | ||
|
||
# Allows you to run this workflow manually from the Actions tab | ||
workflow_dispatch: | ||
|
||
# A workflow run is made up of one or more jobs that can run sequentially or in parallel | ||
jobs: | ||
|
||
# each job goes for each ros supported distribution. | ||
# each job description absorb the distribution dependency as much as possible, | ||
# so that build verification script can be agnostic from distribution dependency. | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
container: | ||
image: ros:rolling | ||
env: | ||
ROS_DISTRO: rolling | ||
steps: | ||
- name: Check out repository code | ||
uses: actions/checkout@v3 | ||
- name: Build with ROS rolling | ||
shell: bash | ||
run: | | ||
./scripts/verification.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,76 @@ | ||
#!/bin/bash | ||
|
||
##################################################################### | ||
# ros2ai ROS 2 Next-Generation Command Line Interface | ||
# | ||
# This script builds ros2ai within ros distro docker images. | ||
# | ||
# To avoid updating and modifying the files under `.github/workflows`, | ||
# this scripts should be adjusted building process accordingly. | ||
# And `.github/workflows` just calls this script in the workflow pipeline. | ||
# This allows us to maintain the workflow process easier for contributers. | ||
# | ||
##################################################################### | ||
|
||
######################## | ||
# Function Definitions # | ||
######################## | ||
|
||
function mark { | ||
export $1=`pwd`; | ||
} | ||
|
||
function exit_trap() { | ||
if [ $? != 0 ]; then | ||
echo "Command [$BASH_COMMAND] is failed" | ||
exit 1 | ||
fi | ||
} | ||
|
||
function install_prerequisites () { | ||
trap exit_trap ERR | ||
echo "[${FUNCNAME[0]}]: update and install dependent packages." | ||
apt update && apt upgrade -y | ||
# TODO@fujitatomoya: should install openai via package.xml | ||
apt install -y pip | ||
pip install openai | ||
#apt install -y ros-${ROS_DISTRO}-desktop --no-install-recommends | ||
cd $there | ||
} | ||
|
||
function setup_build_colcon_env () { | ||
trap exit_trap ERR | ||
echo "[${FUNCNAME[0]}]: set up colcon build environement." | ||
mkdir -p ${COLCON_WORKSPACE}/src | ||
cd ${COLCON_WORKSPACE} | ||
cp -rf $there ${COLCON_WORKSPACE}/src | ||
} | ||
|
||
function build_colcon_package () { | ||
trap exit_trap ERR | ||
echo "[${FUNCNAME[0]}]: build ros2ai package." | ||
source /opt/ros/${ROS_DISTRO}/setup.bash | ||
cd ${COLCON_WORKSPACE} | ||
# TODO@fujitatomoya: extend this with `colcon test`. | ||
colcon build --symlink-install --packages-select ros2ai | ||
} | ||
|
||
######## | ||
# Main # | ||
######## | ||
|
||
export DEBIAN_FRONTEND=noninteractive | ||
export COLCON_WORKSPACE=/tmp/colcon_ws | ||
|
||
# mark the working space root directory, so that we can come back anytime with `cd $there` | ||
mark there | ||
|
||
# set the trap on error | ||
trap exit_trap ERR | ||
|
||
# call install functions in sequence | ||
install_prerequisites | ||
setup_build_colcon_env | ||
build_colcon_package | ||
|
||
exit 0 |