[README] Update #12
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
name: CI of RobotArrayVisualization | |
on: | |
push: | |
branches: | |
- '**' | |
pull_request: | |
branches: | |
- '**' | |
schedule: | |
- cron: '0 0 * * 0' | |
jobs: | |
build-and-test: | |
strategy: | |
fail-fast: false | |
matrix: | |
os: [ubuntu-20.04] | |
build-type: [RelWithDebInfo, Debug] | |
mc-rtc-version: [head, stable] | |
compiler: [gcc] | |
exclude: | |
- build-type: Debug | |
mc-rtc-version: stable | |
runs-on: ${{ matrix.os }} | |
steps: | |
- name: Setup environment variables | |
run: | | |
set -e | |
set -x | |
if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \ | |
[ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \ | |
[ "${{ matrix.mc-rtc-version }}" == "head" ] && \ | |
[ "${{ matrix.compiler }}" == "gcc" ] | |
then | |
echo "RUN_RECORDING_STEPS=true" >> $GITHUB_ENV | |
else | |
echo "RUN_RECORDING_STEPS=false" >> $GITHUB_ENV | |
fi | |
if [ "${{ matrix.os }}" == "ubuntu-20.04" ] && \ | |
[ "${{ matrix.build-type }}" == "RelWithDebInfo" ] && \ | |
[ "${{ matrix.mc-rtc-version }}" == "head" ] && \ | |
[ "${{ matrix.compiler }}" == "gcc" ] | |
then | |
echo "UPLOAD_DOCUMENTATION=true" >> $GITHUB_ENV | |
else | |
echo "UPLOAD_DOCUMENTATION=false" >> $GITHUB_ENV | |
fi | |
echo "DISPLAY=:1" >> $GITHUB_ENV | |
- name: Install dependencies | |
uses: jrl-umi3218/github-actions/install-dependencies@master | |
with: | |
ubuntu: | | |
apt-mirrors: | |
mc-rtc: | |
cloudsmith: mc-rtc/${{ matrix.mc-rtc-version }} | |
apt: librbdyn-dev doxygen graphviz | |
ros: | | |
apt: ros-base | |
- name: Setup display | |
run: | | |
set -e | |
set -x | |
sudo apt-get install -y -qq xvfb ffmpeg mesa-utils fluxbox xserver-xorg xserver-xorg-core xserver-xorg-video-all libwayland-egl1-mesa | |
Xvfb ${{ env.DISPLAY }} -screen 0 1920x1080x24 & | |
sleep 10s | |
fluxbox 2> /dev/null & | |
- name: Catkin build | |
uses: jrl-umi3218/github-actions/build-catkin-project@master | |
with: | |
build-type: ${{ matrix.build-type }} | |
cmake-args: -DINSTALL_DOCUMENTATION=${{ env.UPLOAD_DOCUMENTATION }} | |
catkin-test-args: --no-deps | |
build-packages: robot_array_rviz_plugins | |
test-packages: robot_array_rviz_plugins | |
- name: Record video | |
if: env.RUN_RECORDING_STEPS == 'true' | |
run: | | |
. ${GITHUB_WORKSPACE}/catkin_ws/devel/setup.bash | |
set -e | |
set -x | |
ffmpeg -y -f x11grab -s 1920x1080 -r 30 -i ${DISPLAY} -qscale 0 -vcodec huffyuv /tmp/video.avi > /dev/null 2>&1 < /dev/null & | |
FFMPEG_PID=$! | |
sleep 1s | |
rostest robot_array_rviz_plugins TestSingleRobotStateArrayDisplay.test --text | |
sleep 5s | |
kill -2 ${FFMPEG_PID} | |
sleep 5s | |
mkdir -p /tmp/results | |
ffmpeg -nostats -i /tmp/video.avi /tmp/results/RARP-video.mp4 | |
- name: Upload video | |
if: env.RUN_RECORDING_STEPS == 'true' | |
uses: actions/upload-artifact@v3 | |
with: | |
name: RARP-ci-results | |
path: /tmp/results | |
# - name: Upload documentation | |
# if: env.UPLOAD_DOCUMENTATION == 'true' | |
# run: | | |
# set -e | |
# set -x | |
# cd ${GITHUB_WORKSPACE}/catkin_ws/src/${{ github.repository }} | |
# git config --global user.name "Masaki Murooka" | |
# git config --global user.email "m-murooka@aist.go.jp" | |
# git remote set-url origin "https://mmurooka:${{ secrets.CI_TOKEN }}@github.com/isri-aist/RobotArrayVisualization" | |
# git fetch --depth=1 origin gh-pages:gh-pages | |
# git clean -dfx | |
# rm -rf cmake/ | |
# git checkout --quiet gh-pages | |
# rm -rf doxygen/ | |
# cp -r ${GITHUB_WORKSPACE}/catkin_ws/build/robot_array_rviz_plugins/doc/html/ doxygen | |
# git add doxygen | |
# git_status=`git status -s` | |
# if test -n "$git_status"; then | |
# git commit --quiet -m "Update Doxygen HTML files from commit ${{ github.sha }}" | |
# git push origin gh-pages | |
# else | |
# echo "Github pages documentation is already up-to-date." | |
# fi |