forked from cplusplus/draft
-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
73 lines (67 loc) · 3.41 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
#
# Builds the C++ standard document on Travis CI <https://travis-ci.org/cplusplus/draft>
#
dist: trusty
sudo: required
language: cpp
services:
- docker
before_install:
- docker pull godbyk/texlive-basic:latest
- docker run -itd -v $TRAVIS_BUILD_DIR:/$TRAVIS_REPO_SLUG --name texlive-basic godbyk/texlive-basic
env:
- BUILD_TYPE=latexmk # build using latexmk, also check for overfull hboxes
- BUILD_TYPE=make # build using Makefile
- BUILD_TYPE=complete # build manually and regenerate figures, grammar, and cross-references
- BUILD_TYPE=check-whitespace # check for whitespace at the ends of lines
- BUILD_TYPE=check-newlines # check for blank lines at the ends of files
- BUILD_TYPE=check-macro-use # check for proper macro use
script:
# Build std.pdf
- pushd source
- if [ "$BUILD_TYPE" = "latexmk" ]; then
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && latexmk -pdf std -silent";
! grep -Fe "Overfull \\hbox" std.log &&
! grep "LaTeX Warning..There were undefined references" std.log;
fi
- if [ "$BUILD_TYPE" = "make" ]; then
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && make -j2";
fi
- if [ "$BUILD_TYPE" = "complete" ]; then
for FIGURE in *.dot; do
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && dot -o$(basename $FIGURE .dot).pdf -Tpdf $FIGURE";
done;
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex generalindex";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex libraryindex";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex grammarindex";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex impldefindex";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex -s basic.gst -o xrefindex.gls xrefindex.glo";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && makeindex -s basic.gst -o xrefdelta.gls xrefdelta.glo";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && pdflatex std";
fi
- popd
# Fail if there is whitespace at the ends of any lines
- if [ "$BUILD_TYPE" = "check-whitespace" ]; then
! grep '\s$' source/*.tex;
fi
# Fail if there are blank lines at the ends of any files
- if [ "$BUILD_TYPE" = "check-newlines" ]; then
for f in source/*.tex; do [ $(tail -c 2 $f | wc -l) -eq 1 ] || exit 1; done;
fi
# Fail if macros are used incorrectly
- if [ "$BUILD_TYPE" = "check-macro-use" ]; then
! grep '\\opt[^{}]' source/*.tex;
! grep 'opt{}' source/*.tex;
fi
# Check to see if generated files are out-dated
- pushd source
- for FIGURE in *.dot; do
docker exec -it texlive-basic bash -c "cd /$TRAVIS_REPO_SLUG/source && dot -o$(basename $FIGURE .dot).pdf -Tpdf $FIGURE";
git status --porcelain $(basename $FIGURE .dot).pdf;
done
- popd