|
| 1 | +version: 2 |
| 2 | + |
| 3 | +references: |
| 4 | + setup-tex: &setup-tex |
| 5 | + run: |
| 6 | + name: Setup TeX |
| 7 | + command: sudo apt-get install -qq -y texlive-latex-base ptex-bin latex2html nkf poppler-utils |
| 8 | + setup-eus: &setup-eus |
| 9 | + run: |
| 10 | + name: Setup EusLisp |
| 11 | + command: |- |
| 12 | + 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 |
| 13 | + echo 'export EUSDIR=`pwd`' >> $BASH_ENV |
| 14 | + echo 'export ARCHDIR=Linux64' >> $BASH_ENV |
| 15 | + echo 'export PATH=${PATH}:${EUSDIR}/${ARCHDIR}/bin' >> $BASH_ENV |
| 16 | + echo 'export LD_LIBRARY_PATH=${EUSDIR}/${ARCHDIR}/lib' >> $BASH_ENV |
| 17 | + cat $BASH_ENV |
| 18 | + compile-eus: &compile-eus |
| 19 | + run: |
| 20 | + name: Compile EusLisp |
| 21 | + command: cd lisp; ln -sf Makefile.Linux64 Makefile; make |
| 22 | + |
| 23 | +jobs: |
| 24 | + html: |
| 25 | + machine: true |
| 26 | + steps: |
| 27 | + - checkout |
| 28 | + - *setup-tex |
| 29 | + - run: |
| 30 | + name: Cleanup HTML |
| 31 | + command: cd doc/html && rm *manual*.html *manual*.png |
| 32 | + - run: |
| 33 | + name: Compile HTML |
| 34 | + command: cd doc/latex && make html |
| 35 | + - run: |
| 36 | + name: Compile jHTML |
| 37 | + command: cd doc/jlatex && make html |
| 38 | + - run: |
| 39 | + command: | |
| 40 | + mkdir -p /tmp/html |
| 41 | + cp doc/html/*manual*.html /tmp/html |
| 42 | + cp doc/html/*manual*.png /tmp/html |
| 43 | + - store_artifacts: |
| 44 | + path: /tmp/html |
| 45 | + - persist_to_workspace: |
| 46 | + root: doc |
| 47 | + paths: |
| 48 | + - html/manual*.html |
| 49 | + - html/jmanual*.html |
| 50 | + - html/manual*.png |
| 51 | + - html/jmanual*.png |
| 52 | + |
| 53 | + latex: |
| 54 | + machine: true |
| 55 | + steps: |
| 56 | + - checkout |
| 57 | + - *setup-tex |
| 58 | + - *setup-eus |
| 59 | + - *compile-eus |
| 60 | + - run: |
| 61 | + name: Cleanup LaTeX |
| 62 | + command: cd doc/latex && make distclean |
| 63 | + - run: |
| 64 | + name: Compile LaTeX |
| 65 | + command: | |
| 66 | + cd doc/latex && make |
| 67 | + - store_artifacts: |
| 68 | + path: doc/latex/manual.pdf |
| 69 | + destination: manual.pdf |
| 70 | + - persist_to_workspace: |
| 71 | + root: doc/latex |
| 72 | + paths: manual.pdf |
| 73 | + jlatex: |
| 74 | + machine: true |
| 75 | + steps: |
| 76 | + - checkout |
| 77 | + - *setup-tex |
| 78 | + - *setup-eus |
| 79 | + - *compile-eus |
| 80 | + - run: |
| 81 | + name: Cleanup jLaTeX |
| 82 | + command: cd doc/jlatex && make distclean |
| 83 | + - run: |
| 84 | + name: Compile jLaTeX |
| 85 | + command: | |
| 86 | + cd doc/jlatex && make |
| 87 | + - store_artifacts: |
| 88 | + path: doc/jlatex/jmanual.pdf |
| 89 | + destination: jmanual.pdf |
| 90 | + - persist_to_workspace: |
| 91 | + root: doc/jlatex/ |
| 92 | + paths: jmanual.pdf |
| 93 | + rst: |
| 94 | + machine: true |
| 95 | + steps: |
| 96 | + - checkout |
| 97 | + - *setup-tex |
| 98 | + - run: |
| 99 | + name: Install Python3 |
| 100 | + command: pyenv global system 3.5.2 |
| 101 | + - run: |
| 102 | + name: Install Pandoc |
| 103 | + command: sudo apt-get install -y -qq pandoc |
| 104 | + - run: |
| 105 | + name: Compile reStructuredText(reST) |
| 106 | + command: cd doc/latex && make rst |
| 107 | + - run: |
| 108 | + command: | |
| 109 | + mkdir -p /tmp/rst/fig |
| 110 | + cp doc/latex/*.rst /tmp/rst |
| 111 | + cp doc/latex/fig/*.png /tmp/rst/fig |
| 112 | + cp doc/latex/conf.py /tmp/rst |
| 113 | + - run: |
| 114 | + name: Install Sphinx |
| 115 | + command: | |
| 116 | + pip3 install --user sphinx |
| 117 | + pip3 install --user sphinx_rtd_theme |
| 118 | + - run: |
| 119 | + name: Build reStructuredText(reST) |
| 120 | + command: cd /tmp/rst && ~/.local/bin/sphinx-build . html |
| 121 | + - store_artifacts: |
| 122 | + path: /tmp/rst |
| 123 | + - persist_to_workspace: |
| 124 | + root: /tmp |
| 125 | + paths: rst |
| 126 | + |
| 127 | + artifacts: |
| 128 | + docker: |
| 129 | + - image: circleci/node:8.10.0 |
| 130 | + steps: |
| 131 | + - checkout |
| 132 | + - attach_workspace: |
| 133 | + at: artifacts |
| 134 | + - store_artifacts: |
| 135 | + path: artifacts |
| 136 | + - run: |
| 137 | + command: | |
| 138 | + echo "Check is PR commit : CIRCLE_BRANCH = $CIRCLE_BRANCH" |
| 139 | + if [ "${CIRCLE_BRANCH}" == master ]; then exit 0; fi |
| 140 | + echo "Check if there is commit in doc directory" |
| 141 | + git diff origin/master --name-only --relative doc |
| 142 | + if [ "`git diff origin/master --name-only --relative doc`" == "" ]; then echo "No update in doc directory found, exitting... "; exit 0 ; fi |
| 143 | + echo "Found new commit on doc directory" |
| 144 | + - run: cd .circleci/ && git clone https://github.com/themadcreator/circle-github-bot.git |
| 145 | + - run: cd .circleci/circle-github-bot && npm install |
| 146 | + - run: cd .circleci/circle-github-bot && npm run build |
| 147 | + - run: .circleci/github-pr-update.js |
| 148 | + |
| 149 | +workflows: |
| 150 | + version: 2 |
| 151 | + build: |
| 152 | + jobs: |
| 153 | + - latex |
| 154 | + - jlatex |
| 155 | + - html |
| 156 | + - rst |
| 157 | + - artifacts: |
| 158 | + requires: |
| 159 | + - latex |
| 160 | + - jlatex |
| 161 | + - html |
| 162 | + - rst |
| 163 | + |
0 commit comments