Skip to content
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

Merged
merged 2 commits into from Jun 22, 2016
Merged

Travis CI support #635

merged 2 commits into from Jun 22, 2016

Conversation

godbyk
Copy link
Contributor

@godbyk godbyk commented Mar 9, 2016

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).

@tkoeppe
Copy link
Contributor

tkoeppe commented Mar 9, 2016

Please squash.

- texlive-latex-base
- texlive-latex-extra
- texlive-latex-recommended
- texlive-xetex
Copy link
Contributor

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.

@godbyk
Copy link
Contributor Author

godbyk commented Mar 9, 2016

@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
Copy link
Contributor

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?

Copy link
Contributor Author

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.

Copy link
Contributor

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...

Copy link
Contributor Author

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?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

latexmk

Copy link
Contributor Author

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?

Copy link
Contributor

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.

Copy link
Contributor

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.

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 8, 2016

@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 latexmk seems like a decent smoke test, though on the other hand I don't know how much lifting power that would have.

@zygoloid
Copy link
Member

zygoloid commented Jun 9, 2016

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...).

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 9, 2016

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.

@godbyk
Copy link
Contributor Author

godbyk commented Jun 9, 2016

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.
@godbyk
Copy link
Contributor Author

godbyk commented Jun 14, 2016

I've rebased this PR against master and updated the .travis.yml file to do the following:

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.

You can view the results of this PR at https://travis-ci.org/godbyk/draft/builds/137449847.

@zygoloid zygoloid merged commit fbc8422 into cplusplus:master Jun 22, 2016
@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 29, 2016

@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.

@godbyk
Copy link
Contributor Author

godbyk commented Jun 30, 2016

@tkoeppe What do you mean by 'catches missing xref and grammar regen'?

It just runs git status on the generated files to see if they've changed from what's in the repository. The output of that command appears in the console output, but it doesn't throw a build error or anything.

(We should probably write better tests that do throw errors.)

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 30, 2016

@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?

@godbyk
Copy link
Contributor Author

godbyk commented Jun 30, 2016

@tkoeppe I think it should be possible. Lemme take a look at the Travis CI docs and get back to you.

(The dot-generated figures seem to always differ from the files in the git repository, but I think that's just due to the PDF metadata. We should find a better test for those.)

Are there any other tests we should run?

@tkoeppe
Copy link
Contributor

tkoeppe commented Jun 30, 2016

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!

@godbyk
Copy link
Contributor Author

godbyk commented Jun 30, 2016

@tkoeppe See #780.

FrankHB pushed a commit to FrankHB/draft that referenced this pull request Jul 9, 2016
* 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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants