Skip to content

Commit

Permalink
Rebase from 'upstream'
Browse files Browse the repository at this point in the history
  • Loading branch information
k-okada committed Feb 19, 2020
1 parent d8e46f3 commit 502fddf
Show file tree
Hide file tree
Showing 136 changed files with 9,633 additions and 10,425 deletions.
165 changes: 165 additions & 0 deletions .circleci/config.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,165 @@
version: 2

references:
setup-tex: &setup-tex
run:
name: Setup TeX
command: |-
sudo apt-get update
sudo apt-get install -qq -y texlive-latex-base ptex-bin latex2html nkf poppler-utils
setup-eus: &setup-eus
run:
name: Setup EusLisp
command: |-
sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi
echo 'export EUSDIR=`pwd`' >> $BASH_ENV
echo 'export ARCHDIR=Linux64' >> $BASH_ENV
echo 'export PATH=${PATH}:${EUSDIR}/${ARCHDIR}/bin' >> $BASH_ENV
echo 'export LD_LIBRARY_PATH=${EUSDIR}/${ARCHDIR}/lib' >> $BASH_ENV
cat $BASH_ENV
compile-eus: &compile-eus
run:
name: Compile EusLisp
command: cd lisp; ln -sf Makefile.Linux64 Makefile; make

jobs:
html:
machine: true
steps:
- checkout
- *setup-tex
- run:
name: Cleanup HTML
command: cd doc/html && rm *manual*.html *manual*.png
- run:
name: Compile HTML
command: cd doc/latex && make html
- run:
name: Compile jHTML
command: cd doc/jlatex && make html
- run:
command: |
mkdir -p /tmp/html
cp doc/html/*manual*.html /tmp/html
cp doc/html/*manual*.png /tmp/html
- store_artifacts:
path: /tmp/html
- persist_to_workspace:
root: doc
paths:
- html/manual*.html
- html/jmanual*.html
- html/manual*.png
- html/jmanual*.png

latex:
machine: true
steps:
- checkout
- *setup-tex
- *setup-eus
- *compile-eus
- run:
name: Cleanup LaTeX
command: cd doc/latex && make distclean
- run:
name: Compile LaTeX
command: |
cd doc/latex && make
- store_artifacts:
path: doc/latex/manual.pdf
destination: manual.pdf
- persist_to_workspace:
root: doc/latex
paths: manual.pdf
jlatex:
machine: true
steps:
- checkout
- *setup-tex
- *setup-eus
- *compile-eus
- run:
name: Cleanup jLaTeX
command: cd doc/jlatex && make distclean
- run:
name: Compile jLaTeX
command: |
cd doc/jlatex && make
- store_artifacts:
path: doc/jlatex/jmanual.pdf
destination: jmanual.pdf
- persist_to_workspace:
root: doc/jlatex/
paths: jmanual.pdf
rst:
machine: true
steps:
- checkout
- *setup-tex
- run:
name: Install Python3
command: pyenv global system 3.5.2
- run:
name: Install Pandoc
command: sudo apt-get install -y -qq pandoc
- run:
name: Compile reStructuredText(reST)
command: cd doc/latex && make rst
- run:
command: |
mkdir -p /tmp/rst/fig
cp doc/latex/*.rst /tmp/rst
cp doc/latex/fig/*.png /tmp/rst/fig
cp doc/latex/conf.py /tmp/rst
- run:
name: Install Sphinx
command: |
pip3 install --user sphinx
pip3 install --user sphinx_rtd_theme
- run:
name: Build reStructuredText(reST)
command: cd /tmp/rst && ~/.local/bin/sphinx-build . html
- store_artifacts:
path: /tmp/rst
- persist_to_workspace:
root: /tmp
paths: rst

artifacts:
docker:
- image: circleci/node:8.10.0
steps:
- checkout
- attach_workspace:
at: artifacts
- store_artifacts:
path: artifacts
- run:
command: |
echo "Check is PR commit : CIRCLE_BRANCH = $CIRCLE_BRANCH"
if [ "${CIRCLE_BRANCH}" == master ]; then exit 0; fi
echo "Check if there is commit in doc directory"
git diff origin/master --name-only --relative doc
if [ "`git diff origin/master --name-only --relative doc`" == "" ]; then echo "No update in doc directory found, exitting... "; circleci step halt; fi
echo "Found new commit on doc directory"
- run: cd .circleci/ && git clone https://github.com/themadcreator/circle-github-bot.git
- run: cd .circleci/circle-github-bot && npm install
- run: cd .circleci/circle-github-bot && npm run build
- run: .circleci/github-pr-update.js

workflows:
version: 2
build:
jobs:
- latex
- jlatex
- html
- rst
- artifacts:
requires:
- latex
- jlatex
- html
- rst

14 changes: 14 additions & 0 deletions .circleci/github-pr-update.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
#!/usr/bin/env node

const bot = require("./circle-github-bot/").create();

bot.comment(process.env.GH_AUTH_TOKEN, `
Thank you for contributing EusLisp documentation<br>
Please check latest documents before merging<br>
PDF version of English manual: <strong>${bot.artifactLink('artifacts/manual.pdf', 'manual.pdf')}</strong>
PDF version of Japanese jmanual: <strong>${bot.artifactLink('artifacts/jmanual.pdf', 'jmanual.pdf')}</strong>
HTML version of English manual: <strong>${bot.artifactLink('artifacts/html/manual.html', 'manual.html')}</strong>
HTML version of Japanese manual: <strong>${bot.artifactLink('artifacts/html/jmanual.html', 'jmanual.html')}</strong>
Sphinx (ReST) version of English manual: <strong>${bot.artifactLink('artifacts/rst/html/manual.html', 'manual.rst')}</strong>
`);
126 changes: 111 additions & 15 deletions .travis.sh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,11 @@ set -e
export DEBIAN_FRONTEND=noninteractive

function travis_time_start {
TRAVIS_START_TIME=$(date +%s)
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
TRAVIS_START_TIME=$(( $(date +%s)*1000000000 ))
else
TRAVIS_START_TIME=$(date +%s%N)
fi
TRAVIS_TIME_ID=$(cat /dev/urandom | LC_ALL=C LC_CTYPE=C tr -dc 'a-z0-9' | fold -w 8 | head -n 1)
TRAVIS_FOLD_NAME=$1
echo -e "\e[0Ktravis_fold:start:$TRAVIS_FOLD_NAME"
Expand All @@ -14,7 +18,11 @@ function travis_time_start {
function travis_time_end {
set +x # disable debug information
_COLOR=${1:-32}
TRAVIS_END_TIME=$(date +%s)
if [ "$TRAVIS_OS_NAME" == "osx" ]; then
TRAVIS_END_TIME=$(( $(date +%s)*1000000000 ))
else
TRAVIS_END_TIME=$(date +%s%N)
fi
TIME_ELAPSED_SECONDS=$(( ($TRAVIS_END_TIME - $TRAVIS_START_TIME)/1000000000 ))
echo -e "travis_time:end:$TRAVIS_TIME_ID:start=$TRAVIS_START_TIME,finish=$TRAVIS_END_TIME,duration=$(($TRAVIS_END_TIME - $TRAVIS_START_TIME))\n\e[0K"
echo -e "travis_fold:end:$TRAVIS_FOLD_NAME"
Expand All @@ -28,7 +36,9 @@ if [ "$TRAVIS_OS_NAME" == "linux" ]; then
travis_time_end

travis_time_start setup.apt-get_install
ret=1; while [ $ret != 0 ]; do sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi && ret=0 || echo "failed, retry"; done # msttcorefonts could not install on 14.04 travis
ret=1; while [ $ret != 0 ]; do sudo apt-get install -qq -y git make gcc g++ libjpeg-dev libxext-dev libx11-dev libgl1-mesa-dev libglu1-mesa-dev libpq-dev libpng-dev xfonts-100dpi xfonts-75dpi pkg-config libbullet-dev && ret=0 || echo "failed, retry"; done # msttcorefonts could not install on 14.04 travis
# unset protocol version https://github.com/juju/charm-tools/issues/532
git config --global --unset protocol.version || echo "OK"
if [ "`uname -m`" == "x86_64" ] ; then sudo apt-get install -qq -y texlive-latex-base ptex-bin latex2html nkf poppler-utils || echo "ok"; fi # 16.04 does ont have ptex bin
travis_time_end

Expand All @@ -38,16 +48,76 @@ if [ "$TRAVIS_OS_NAME" == "osx" ]; then
# skip if already installed
# https://discourse.brew.sh/t/skip-ignore-brew-install-if-package-is-already-installed/633/2
# brew install jpeg libpng mesalib-glw;
brew list jpeg &>/dev/null || brew install jpeg
brew list libpng &>/dev/null || brew install libpng
brew list mesalib-glw &>/dev/null || brew install mesalib-glw
# use HOMEBREW_NO_AUT_UPDATE to fix unexpected keyword error https://travis-ci.community/t/syntax-error-unexpected-keyword-rescue-expecting-keyword-end-in-homebrew/5623
brew list jpeg &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install jpeg
brew list libpng &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install libpng
brew list mesalib-glw &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install mesalib-glw
brew list bullet &>/dev/null || HOMEBREW_NO_AUTO_UPDATE=1 brew install bullet
travis_time_end

fi

### for multiarch compile test
if [ "$QEMU" != "" ]; then
travis_time_start install.dpkg-dev
apt-get install -qq -y dpkg-dev
travis_time_end

echo "uname -a : $(uname -a)"
echo "uname -m : $(uname -m)"
echo "gcc -dumpmachine : $(gcc -dumpmachine)"
echo "gcc -dumpversion : $(gcc -dumpversion)"
echo "getconf LONG_BIT : $(getconf LONG_BIT)"

travis_time_start compile.euslisp
export EUSDIR=`pwd`
eval "$(dpkg-buildflags --export=sh)"
make -C lisp -f Makefile.Linux eus0 eus1 eus2 eusg eusx eusgl eus eusjpeg
travis_time_end

if [[ `gcc -dumpmachine | egrep "^(arm|aarch)"` != "" ]]; then
export ARCHDIR=LinuxARM
elif [[ `gcc -dumpmachine | egrep "^x86_64"` != "" ]]; then
export ARCHDIR=Linux64
else
export ARCHDIR=Linux
fi
export PATH=`pwd`/$ARCHDIR/bin:$PATH

export EXIT_STATUS=0;
set +e
# run test in EusLisp/test
for test_l in test/*.l; do

travis_time_start euslisp.${test_l##*/}.test

sed -i 's/\(i-max\ [0-9]000\)0*/\1/' $test_l

eusgl $test_l;
export TMP_EXIT_STATUS=$?

travis_time_end `expr 32 - $TMP_EXIT_STATUS`

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
done;
echo "Exit status : $EXIT_STATUS";

travis_time_start euslisp.eusjpeg.test

eusgl '(progn (load (format nil "~A/lisp/image/jpeg/eusjpeg.l" *eusdir*))(image::write-jpeg-file "test.jpg" (instance color-image24 :init 100 100)) (print *user*) (unix::exit))'

export TMP_EXIT_STATUS=$?

travis_time_end `expr 32 - $TMP_EXIT_STATUS`
export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
echo "Exit status : $EXIT_STATUS";
[ $EXIT_STATUS == 0 ] || exit 1
exit 0
fi

travis_time_start install # Use this to install any prerequisites or dependencies necessary to run your build
cd ${HOME}
[ -e jskeus ] || git clone http://github.com/euslisp/jskeus jskeus
[ -e jskeus ] || git clone --depth 1 http://github.com/euslisp/jskeus jskeus
ln -s $CI_SOURCE_PATH jskeus/eus
ln -s `pwd`/jskeus/irteus jskeus/eus/irteus
travis_time_end
Expand All @@ -61,6 +131,13 @@ else
fi
make

travis_time_start script.eustag

(cd eus/lisp/tool; make)

travis_time_end


travis_time_end

if [ "$TRAVIS_OS_NAME" == "linux" -a "`uname -m`" == "x86_64" -a "$ROS_DISTRO" != "" ]; then
Expand Down Expand Up @@ -144,24 +221,34 @@ fi

travis_time_end `expr 32 - $TMP_EXIT_STATUS`

if [[ $TMP_EXIT_STATUS != 0 ]]; then echo "Failed running $test_l. Exiting with $TMP_EXIT_STATUS"; fi

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
done;
echo "Exit status : $EXIT_STATUS";


# run test in compiled EusLisp/test
for test_l in $CI_SOURCE_PATH/test/*.l; do
# bignum test fails on armhf
[[ "`uname -m`" == "arm"* && $test_l =~ bignum.l ]] && continue;
# const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
[[ $test_l =~ const.l ]] && continue;

travis_time_start compiled.${test_l##*/}.test

eusgl "(let ((o (namestring (merge-pathnames \".o\" \"$test_l\"))) (so (namestring (merge-pathnames \".so\" \"$test_l\")))) (compile-file \"$test_l\" :o o) (if (probe-file so) (load so) (exit 1))))"
export TMP_EXIT_STATUS=$?

travis_time_end `expr 32 - $TMP_EXIT_STATUS`
export CONTINUE=0
# bignum test fails on armhf
if [[ "`uname -m`" == "arm"* && $test_l =~ bignum.l ]]; then export CONTINUE=1; fi
# sort test fails on armhf (https://github.com/euslisp/EusLisp/issues/232)
if [[ "`uname -m`" == "arm"* && $test_l =~ sort.l ]]; then export CONTINUE=1; fi
# const.l does not compilable https://github.com/euslisp/EusLisp/issues/318
if [[ $test_l =~ const.l ]]; then export CONTINUE=1; fi

if [[ $CONTINUE == 0 ]]; then travis_time_end `expr 32 - $TMP_EXIT_STATUS`; else travis_time_end 33; fi

if [[ $TMP_EXIT_STATUS != 0 ]]; then echo "Failed running $test_l. Exiting with $TMP_EXIT_STATUS"; fi

if [[ $CONTINUE != 0 ]]; then continue; fi

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
done;
Expand All @@ -170,14 +257,23 @@ fi
# run test in jskeus/irteus
for test_l in irteus/test/*.l; do

[[ ("`uname -m`" == "arm"* || "`uname -m`" == "aarch"*) && $test_l =~ geo.l|mathtest.l|interpolator.l|test-irt-motion.l|test-pointcloud.l|irteus-demo.l ]] && continue;

travis_time_start irteus.${test_l##*/}.test

irteusgl $test_l;
export TMP_EXIT_STATUS=$?

travis_time_end `expr 32 - $TMP_EXIT_STATUS`
export CONTINUE=0
# irteus-demo.l, robot-model-usage.l and test-irt-motion.l fails on armhf both trusty and xenial
if [[ "`uname -m`" == "arm"* && $test_l =~ irteus-demo.l|robot-model-usage.l|test-irt-motion.l ]]; then export CONTINUE=1; fi
# skip collision test because bullet of 2.83 or later version is not released in trusty and jessie.
# https://github.com/euslisp/jskeus/blob/6cb08aa6c66fa8759591de25b7da68baf76d5f09/irteus/Makefile#L37
if [[ ( "$DOCKER_IMAGE" == *"trusty"* || "$DOCKER_IMAGE" == *"jessie"* ) && $test_l =~ test-collision.l ]]; then export CONTINUE=1; fi

if [[ $CONTINUE == 0 ]]; then travis_time_end `expr 32 - $TMP_EXIT_STATUS`; else travis_time_end 33; fi

if [[ $TMP_EXIT_STATUS != 0 ]]; then echo "Failed running $test_l. Exiting with $TMP_EXIT_STATUS"; fi

if [[ $CONTINUE != 0 ]]; then continue; fi

export EXIT_STATUS=`expr $TMP_EXIT_STATUS + $EXIT_STATUS`;
done;
Expand Down
Loading

0 comments on commit 502fddf

Please sign in to comment.