Skip to content

Commit

Permalink
Merge pull request #479 from k-okada/fix_ga
Browse files Browse the repository at this point in the history
integrate all .github/workflows/*.yml to config.yml, fix permission issue
  • Loading branch information
k-okada committed May 28, 2022
2 parents e77d628 + 0371bc3 commit afa67a0
Show file tree
Hide file tree
Showing 19 changed files with 204 additions and 140 deletions.
111 changes: 111 additions & 0 deletions .github/workflows/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
# jsk_travis
on:
push:
branches:
- master
pull_request:

env:
DISPLAY: ':0.0'

jobs:
ros:
runs-on: ubuntu-latest
# continue-on-error: ${{ matrix.experimental }}
strategy:
fail-fast: false
matrix:
include:
- ROS_DISTRO: indigo
CONTAINER: jskrobotics/ros-ubuntu:14.04
USE_DEB : true
EXTRA_DEB: "ros-indigo-pr2-gazebo ros-indigo-pr2-arm-kinematics"
NOT_TEST_INSTALL: true
TEST_PKGS: "pr2eus"
BEFORE_SCRIPT: "echo 'deb http://packages.osrfoundation.org/gazebo/ubuntu trusty main' | sudo tee /etc/apt/sources.list.d/gazebo-stable.list; wget --no-check-certificate https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -; sudo apt update -y; sudo apt dist-upgrade -y; mkdir -p ~/.gazebo/; git clone --depth=1 https://github.com/osrf/gazebo_models.git ~/.gazebo/models"
- ROS_DISTRO: indigo
CONTAINER: jskrobotics/ros-ubuntu:14.04
USE_DEB : true
EXTRA_DEB: "ros-indigo-pr2-gazebo ros-indigo-pr2-arm-kinematics"
NOT_TEST_INSTALL: true
TEST_PKGS: "pr2eus_moveit pr2eus_tutorials"
BEFORE_SCRIPT: "echo 'deb http://packages.osrfoundation.org/gazebo/ubuntu trusty main' | sudo tee /etc/apt/sources.list.d/gazebo-stable.list; wget --no-check-certificate https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -; sudo apt update -y; sudo apt dist-upgrade -y; mkdir -p ~/.gazebo/; git clone --depth=1 https://github.com/osrf/gazebo_models.git ~/.gazebo/models"
- ROS_DISTRO: kinetic
CONTAINER: ubuntu:16.04
USE_DEB : true
TEST_PKGS: "pr2eus"
EXTRA_DEB: "ros-kinetic-moveit-ros-perception"
BEFORE_SCRIPT: "echo 'deb http://packages.osrfoundation.org/gazebo/ubuntu xenial main' | sudo tee /etc/apt/sources.list.d/gazebo-stable.list; wget --no-check-certificate https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -; sudo apt update -y"
- ROS_DISTRO: kinetic
CONTAINER: ubuntu:16.04
USE_DEB : true
TEST_PKGS: "pr2eus_moveit pr2eus_tutorials"
EXTRA_DEB: "ros-kinetic-moveit-ros-perception"
BEFORE_SCRIPT: "echo 'deb http://packages.osrfoundation.org/gazebo/ubuntu xenial main' | sudo tee /etc/apt/sources.list.d/gazebo-stable.list; wget --no-check-certificate https://packages.osrfoundation.org/gazebo.key -O - | sudo apt-key add -; sudo apt update -y"
- ROS_DISTRO: melodic
CONTAINER: ubuntu:18.04
USE_DEB : true
TEST_PKGS: "pr2eus"
- ROS_DISTRO: melodic
CONTAINER: ubuntu:18.04
USE_DEB : true
TEST_PKGS: "pr2eus_moveit pr2eus_tutorials"
# - ROS_DISTRO: noetic
# CONTAINER: ubuntu:20.04
# USE_DEB : true
# TEST_PKGS: "pr2eus"
# - ROS_DISTRO: noetic
# CONTAINER: ubuntu:20.04
# USE_DEB : true
# TEST_PKGS: "pr2eus_moveit pr2eus_tutorials"
- ROS_DISTRO: noetic
CONTAINER: ubuntu:20.04
USE_DEB : false
BUILD_PKGS: "pr2eus_moveit pr2eus_tutorials"
TEST_PKGS: "pr2eus"
- ROS_DISTRO: noetic
CONTAINER: ubuntu:20.04
USE_DEB : false
BUILD_PKGS: "pr2eus_moveit pr2eus_tutorials"
TEST_PKGS: "pr2eus_moveit pr2eus_tutorials"


container: ${{ matrix.CONTAINER }}

steps:
- name: Install latest git ( use sudo for ros-ubuntu )
run: |
(apt-get update && apt-get install -y sudo) || echo "OK"
sudo apt-get update && sudo apt-get install -y software-properties-common && sudo apt-get update && sudo add-apt-repository -y ppa:git-core/ppa && sudo apt-get update && sudo apt-get install -y git
- name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613
run: |
set -x
export USER=$(whoami)
if [ "${{ matrix.CONTAINER }}" = "jskrobotics/ros-ubuntu:14.04" ]; then
git config --global --add safe.directory $GITHUB_WORKSPACE || echo "OK" # Show 'could not lock config file /github/home/.gitconfig: Permission denied', but it is ok
sudo mkdir -p /__w/
sudo chmod 777 -R /__w/
sudo chown -R $USER $HOME
# sudo mkdir -p /home/runner/work/_temp/_github_workflow/
# sudo chown -R $USER $HOME /home/runner/work/_temp/_github_workflow/
# ls -al /home/runner/work/_temp/_github_workflow/
else
git config --global --add safe.directory $GITHUB_WORKSPACE
fi
- name: Chcekout
uses: actions/checkout@v2

- name: Run jsk_travis
uses: jsk-ros-pkg/jsk_travis@master
with:
ROS_PARALLEL_TEST_JOBS : "-j1"
CATKIN_PARALLEL_TEST_JOBS : "-p1"
ROS_DISTRO : ${{ matrix.ROS_DISTRO }}
USE_DEB : ${{ matrix.USE_DEB }}
NOT_TEST_INSTALL : ${{ matrix.NOT_TEST_INSTALL }}
BUILD_PKGS: ${{ matrix.BUILD_PKGS }}
TEST_PKGS : ${{ matrix.TEST_PKGS }}
EXTRA_DEB : ${{ matrix.EXTRA_DEB }}
BEFORE_SCRIPT : ${{ matrix.BEFORE_SCRIPT }}
33 changes: 0 additions & 33 deletions .github/workflows/indigo.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/kinetic.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/melodic.yml

This file was deleted.

30 changes: 0 additions & 30 deletions .github/workflows/noetic.yml

This file was deleted.

18 changes: 18 additions & 0 deletions .github/workflows/python2.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# generated by `./generate_action_config.py noetic`
# jsk_travis
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
name: check_python2

container: ubuntu:20.04

steps:
- name: Chcekout
uses: actions/checkout@v2
- name: Check Python2
run: |
apt update -q && apt install -y -q python2
python2 -m compileall .
22 changes: 22 additions & 0 deletions .github/workflows/python3.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# generated by `./generate_action_config.py noetic`
# jsk_travis
on: [push, pull_request]

jobs:
test:
runs-on: ubuntu-latest
name: check_python3

container: ubuntu:20.04

steps:
- name: Install latest git to download .git directory in actions/checkout@v2 ( use sudo for ros-ubuntu )
run: apt-get update && apt-get install -y software-properties-common && apt-get update && add-apt-repository -y ppa:git-core/ppa && apt-get update && apt-get install -y git
- name: work around permission issue # https://github.com/actions/checkout/issues/760#issuecomment-1097501613
run: git config --global --add safe.directory $GITHUB_WORKSPACE
- name: Chcekout
uses: actions/checkout@v2
- name: Check Python3
run: |
apt update -q && apt install -y -q python3 git 2to3
bash -c "ret=0; trap 'ret=1' ERR; python3 -m compileall .; 2to3 -w -f except -f execfile -f has_key -f import -f raw_input -f zip .; git diff --exit-code . > /dev/null; echo Exitting with \$ret; exit \$ret"
3 changes: 3 additions & 0 deletions .travis.rosinstall
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@
- git:
uri: https://github.com/jsk-ros-pkg/jsk_roseus.git
local-name: jsk-ros-pkg/jsk_roseus
- git:
uri: https://github.com/jsk-ros-pkg/jsk_model_tools.git
local-name: jsk-ros-pkg/jsk_model_tools
2 changes: 2 additions & 0 deletions pr2eus/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,8 @@ if(CATKIN_ENABLE_TESTING)
find_package(pr2_gazebo QUIET)
if(pr2_gazebo_FOUND AND (NOT pr2_gazebo_VERSION VERSION_LESS 2.0.7)) # test only supports indigo
add_rostest(test/pr2-ri-test.launch)
add_rostest(test/pr2-ri-test-arm.launch)
add_rostest(test/pr2-ri-test-base.launch)
add_rostest(test/pr2-ri-test-namespace.launch)
endif()
add_rostest(test/pr2-ri-test-simple.launch)
Expand Down
9 changes: 9 additions & 0 deletions pr2eus/test/pr2-ri-test-arm.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<launch>
<arg name="gui" default="false"/>
<include file="$(find pr2eus)/test/pr2-ri-test-bringup.launch"
pass_all_args="true" />

<!-- start test -->
<test test-name="pr2_ri_test_arm" pkg="roseus" type="roseus" retry="1"
args="$(find pr2eus)/test/pr2-ri-test-arm.l" time-limit="800" />
</launch>
9 changes: 9 additions & 0 deletions pr2eus/test/pr2-ri-test-base.launch
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<launch>
<arg name="gui" default="false"/>
<include file="$(find pr2eus)/test/pr2-ri-test-bringup.launch"
pass_all_args="true" />

<!-- start test -->
<test test-name="pr2_ri_test_base" pkg="roseus" type="roseus" retry="1"
args="$(find pr2eus)/test/pr2-ri-test-base.l" time-limit="800" />
</launch>
4 changes: 0 additions & 4 deletions pr2eus/test/pr2-ri-test.launch
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,6 @@
pass_all_args="true" />

<!-- start test -->
<test test-name="pr2_ri_test_arm" pkg="roseus" type="roseus" retry="1"
args="$(find pr2eus)/test/pr2-ri-test-arm.l" time-limit="800" />
<test test-name="pr2_ri_test_base" pkg="roseus" type="roseus" retry="1"
args="$(find pr2eus)/test/pr2-ri-test-base.l" time-limit="800" />
<test test-name="pr2_ri_test_simple" pkg="roseus" type="roseus" retry="1"
args="$(find pr2eus)/test/pr2-ri-test-simple.l" time-limit="800" />
</launch>
2 changes: 1 addition & 1 deletion pr2eus/test/speak-test-eus.test
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
<env name="DISPLAY" value=":0.0" />
<arg name="test_action" default="false" />

<test test-name="stest_peak_publish_euslisp_$(arg test_action)" pkg="roseus" type="roseus"
<test test-name="test_speak_publish_euslisp_$(arg test_action)" pkg="roseus" type="roseus"
args="$(find pr2eus)/test/speak-test.l"/>

<group if="$(arg test_action)" >
Expand Down
13 changes: 8 additions & 5 deletions pr2eus/test/test_dummy_soundplay_node.py
Original file line number Diff line number Diff line change
Expand Up @@ -170,7 +170,7 @@ def get_staleness(self):
pass
# position = self.sound.query_position(gst.FORMAT_TIME)[0]
# duration = self.sound.query_duration(gst.FORMAT_TIME)[0]
except Exception, e:
except Exception as e:
position = 0
duration = 0
finally:
Expand Down Expand Up @@ -232,6 +232,9 @@ def select_sound(self, data):
os.close(wavfile)
voice = data.arg2
try:
# try to encode if data.args is not string for pytho3n
if sys.version_info.major >= 3 and type(data.arg) is str:
data.arg = data.arg.encode()
txtfile.write(data.arg)
txtfile.flush()
rospy.loginfo("text2wave -eval '("+voice+")' "+txtfilename+" -o "+wavfilename)
Expand Down Expand Up @@ -279,7 +282,7 @@ def callback(self,data):
else:
sound = self.select_sound(data)
sound.command(data.command)
except Exception, e:
except Exception as e:
rospy.logerr('Exception in callback: %s'%str(e))
rospy.loginfo(traceback.format_exc())
finally:
Expand All @@ -292,7 +295,7 @@ def cleanupdict(self, dict):
for (key,sound) in dict.iteritems():
try:
staleness = sound.get_staleness()
except Exception, e:
except Exception as e:
rospy.logerr('Exception in cleanupdict for sound (%s): %s'%(str(key),str(e)))
staleness = 100 # Something is wrong. Let's purge and try again.
#print "%s %i"%(key, staleness)
Expand Down Expand Up @@ -339,7 +342,7 @@ def diagnostics(self, state):
da.status.append(ds)
da.header.stamp = rospy.get_rostime()
self.diagnostic_pub.publish(da)
except Exception, e:
except Exception as e:
rospy.loginfo('Exception in diagnostics: %s'%str(e))

def execute_cb(self, data):
Expand Down Expand Up @@ -379,7 +382,7 @@ def execute_cb(self, data):
rospy.loginfo('sound_play action: Succeeded')
self._as.set_succeeded(self._result)

except Exception, e:
except Exception as e:
rospy.logerr('Exception in actionlib callback: %s'%str(e))
rospy.loginfo(traceback.format_exc())
finally:
Expand Down

0 comments on commit afa67a0

Please sign in to comment.