-
Notifications
You must be signed in to change notification settings - Fork 8
/
.travis.yml
113 lines (107 loc) · 4.26 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
# Only build tags:
if: type = pull_request
os:
- windows
- linux
- osx
dist: focal
osx_image: xcode12.2
language: shell
notifications:
email: false
git:
submodules: false
# Install packages
install:
- _py_ver="3.8"
# - _full_pip="true"
- _full_pip="false"
- |
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
choco install miniconda3
_pref="/c/tools/miniconda3"
export PATH="$_pref:$_pref/Scripts:$_pref/condabin:$PATH"
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
wget https://repo.anaconda.com/miniconda/Miniconda3-latest-MacOSX-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
_pref="--yes"
else
sudo apt-get update
sudo apt-get install -y ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils
wget https://repo.continuum.io/miniconda/Miniconda3-latest-Linux-x86_64.sh -O miniconda.sh
bash miniconda.sh -b -p $HOME/miniconda
export PATH="$HOME/miniconda/bin:$PATH"
_pref="--yes"
fi
- hash -r
- source activate base
- conda config --set always_yes yes --set changeps1 no
- conda config --add channels conda-forge
- conda config --add channels defaults
- conda update -y conda
# Useful for debugging any issues with conda
- conda info -a
- |
if [ "$_full_pip" = "true" ]; then
conda create -y -n test-pandoctools "python=$_py_ver"
else
conda create -y -n test-pandoctools "python=$_py_ver" "pip>=10.0.1" click pyyaml notebook jupyter \
libsass "shutilwhich-cwdpatch>=0.1.0" "panflute>=1.12.4" "knitty>=0.6.1" "pyppdf>=0.1.1" \
"py-mathjax<3.0" "sugartex>=0.1.16" "shortcutter>=0.1.19" "numpy" "py-pandoc>=2.8.0.1" \
"py-pandoc-crossref>=0.3.5.0.1" "jupyter_console>=6.0.0" "py-open-fonts>=0.7.0"
fi
- git clone https://github.com/kiwi0fruit/pyappshare
- git clone https://github.com/kiwi0fruit/sugartex
- git clone https://github.com/back0up/pandoctools-ci
- git config --global user.email "travis@travis-ci.org"
- git config --global user.name "Travis-CI"
- source activate test-pandoctools
# - pip install git+https://github.com/kiwi0fruit/pyppdf.git
- pip install -e .
- |
if [ "$TRAVIS_OS_NAME" = 'windows' ]; then
echo windows
elif [ "$TRAVIS_OS_NAME" = 'osx' ]; then
echo osx
else
mkdir -p ~/Desktop
mkdir -p ~/.local/share/applications
fi
- pandoctools-ready
- bash ./pyappshare/simple_envs/python3/install "${_pref}"
- bash ./pyappshare/simple_envs/r/install "${_pref}"
- jupyter kernelspec list
- rm ./examples/doc.ipynb
- rm ./examples/doc.pdf
- rm ./examples/notebook.ipynb
- rm ./examples/notebook.pdf
- rm ./sugartex/examples/examples.pdf
# Run test
script:
- pandoctools --yes ./examples/doc.md
- pandoctools --yes ./examples/doc.md -o "*.pdf"
- pandoctools --yes ./examples/notebook.py
- pandoctools --yes ./examples/notebook.py -o "*.pdf"
- xx="./sugartex/examples/examples"
- pandoctools --yes "$xx.md" -o "*.ipynb"
- |
pandoctools --yes "$xx.md" -o "*.pdf" && [ -f "$xx.pdf" ] ||
pandoctools --yes "$xx.md" -o "*.pdf" && [ -f "$xx.pdf" ] ||
pandoctools --yes "$xx.md" -o "*.pdf" && [ -f "$xx.pdf" ] ||
pandoctools --yes "$xx.md" -o "*.pdf" && [ -f "$xx.pdf" ] ||
pandoctools --yes "$xx.md" -o "*.pdf"
- cd ./pandoctools-ci
- git pull
- git pull
- rm -rf ./$TRAVIS_OS_NAME
- mkdir -p ./$TRAVIS_OS_NAME
- cp ../examples/doc.pdf ./$TRAVIS_OS_NAME
- cp ../examples/doc.ipynb ./$TRAVIS_OS_NAME
- cp ../examples/notebook.pdf ./$TRAVIS_OS_NAME
- cp ../examples/notebook.ipynb ./$TRAVIS_OS_NAME
- cp ../sugartex/examples/examples.pdf ./$TRAVIS_OS_NAME
- cp ../sugartex/examples/examples.ipynb ./$TRAVIS_OS_NAME
- git add .
- git commit --message "Travis build $TRAVIS_BUILD_NUMBER"
- git push "https://${back0up_PAT}@github.com/back0up/pandoctools-ci.git" master > /dev/null 2>&1