New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Travis CI support #635
Travis CI support #635
Conversation
Please squash. |
- texlive-latex-base | ||
- texlive-latex-extra | ||
- texlive-latex-recommended | ||
- texlive-xetex |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't think we need xetex.
@tkoeppe I've squashed the commits. I also removed the unnecessary package and unused repository. Thanks! |
@@ -0,0 +1,21 @@ | |||
script: | |||
- pushd source | |||
- make -j2 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why use make
if you are already installing latexmk
below?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkoeppe Only because I know make
works and have never tried building it with latexmk
. If latexmk
works and is preferred, I'm happy to use it instead.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Well, either use make
and don't install latexmk
, or use latexmk
, I'd say...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkoeppe I'm not picky. Which method is preferred?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
latexmk
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@tkoeppe I'll give latexmk
a try. I think I'll have to duplicate some of the effort from the Makefile
to the .travis.xml
file (e.g., building the diagram PDFs with dot
, generating the grammar and cross-references appendices) since latexmk
won't do that for us.
Is it worth the effort or is it better to rely on the Makefile
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, it maybe that latexmk
doesn't go the whole way and is only useful for the common case of small changes. In that case stick with make
, sure.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
On second thought, please do use latexmk
for the test. The regeneration of the xrefs and grammar and plots is not a transient operation; and thus make
is a tool for the author, not the user (despite what we say in the readme). If make
were a user-facing tool, then we wouldn't have the grammar and xrefs checked in.
Note also that just make
doesn't regenerate anything, since it only runs rebuild
by default.
In summary, the semantics of latexmk -pdf std
seem to be exactly what we want.
@zygoloid: What do you think of adding Travis testing? I think it may require you to link the repository to Travis somehow and give them access. Running |
Sounds like a good idea to me. What sort of access do they require? Presumably push access isn't required for them to do this integration? In addition to latexmk, it might be interesting to run the various regeneration steps (makegram etc) and check that the checked-in outputs of these steps don't change (though I do wonder how much sense it makes to check in a generated file in the first place...). |
Setup instructions here: https://docs.travis-ci.com/user/getting-started/#To-get-started-with-Travis-CI%3A I agree in principle that checking in generated files is iffy, but at least the current setup separates LaTeX editing from our own homebrew scripts. I wouldn't want to mandate that any user be able to execute our scripts (i.e. if we didn't ship the generated files, some people might not be able to build at all). However, I would be quite happy to have a test that a simple LaTeX edit does't change the output of the generated files, as you suggested, so it would indeed be nice if we could make Travis run that test. |
I would recommend setting up a matrix and having Travis CI build the files with both latexmk and using the build scripts. |
Travis CI will build std.pdf in four different ways: 1. Using latexmk. 2. Using make. 3. Manually per the instructions in README.rst. 4. Manually (same as 3), but also regenerating the grammar annex, cross-references, and figures. It also regenerates the grammar annex, cross-references, and figures and compares them to the pre-generated versions checked into the repository.
I've rebased this PR against master and updated the Travis CI will build
It also regenerates the grammar annex, cross-references, and figures and compares them to the pre-generated versions checked into the repository. You can view the results of this PR at https://travis-ci.org/godbyk/draft/builds/137449847. |
@godbyk: Are you sure this testing catches missing xref and grammar regen? I just pushed a branch that was missing the regeneration, and all four tests passed. |
@tkoeppe What do you mean by 'catches missing xref and grammar regen'? It just runs (We should probably write better tests that do throw errors.) |
@godbyk Oh - but who reads the 5MB of console output? I thought it should be a test failure if you end up affecting the xrefs without checking them in yourself. Is that possible? |
@tkoeppe I think it should be possible. Lemme take a look at the Travis CI docs and get back to you. (The Are there any other tests we should run? |
I really don't care about the figures, but the xrefs have just caught us out a few times just now while we've been applying motions, so there'd be plenty of value in testing those. Thanks! |
* Adds Travis CI support. Travis CI will build std.pdf in four different ways: 1. Using latexmk. 2. Using make. 3. Manually per the instructions in README.rst. 4. Manually (same as 3), but also regenerating the grammar annex, cross-references, and figures. It also regenerates the grammar annex, cross-references, and figures and compares them to the pre-generated versions checked into the repository. * Removed spurious newline.
This allows the PDF to be built using Travis CI. Handy for catching syntax errors in pull requests.
The build script could be expanded to add other checks in the future, too (for example, raise errors on too overfull lines, missing cross-reference labels).