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

Make CI builds fail when building docs fails #527

Closed
nalimilan opened this issue Jun 26, 2017 · 9 comments
Closed

Make CI builds fail when building docs fails #527

nalimilan opened this issue Jun 26, 2017 · 9 comments

Comments

@nalimilan
Copy link
Contributor

The current recommended Travis CI configuration does not mark a package's build as failed when the docs fail to build. This is problematic since it means the documentation can silently fail to be updated. In particular, doctests can fail due to changes done in a PR without the CI checks making this apparent.

Wouldn't it make sense to make builds fail by default if docs failed to build? Or is that difficult to implement?

@mortenpi
Copy link
Member

Build stages is the way to go here: https://docs.travis-ci.com/user/build-stages

But you can also just run Documenter in your tests (i.e. have the include() in test/runtests.jl) if you'd like them to fail when deployment fails. Not much to implement here, although it's not a very pretty solution. Hence, I was extremely excited when I heard about build stages. Needs to be tested and documented though.

@nalimilan
Copy link
Contributor Author

Interesting. Any idea what a .travis.yml file using stages could look like?

@mortenpi
Copy link
Member

mortenpi commented Jun 26, 2017

I played around with them a bit when they came out: .travis.yml and the corresponding Travis build.

Edit: I think for a package the it would look like:

jobs:
  include:
    - stage: "Deploy docs"
      julia: nightly
      os: linux
      script: julia --color=yes -e 'Pkg.add("Documenter")'
        && julia --color=yes docs/make.jl deploy

Edit2: Note that I have deploydocs wrapped in an ARGS check there:

"deploy" in ARGS && deploydocs(
    repo = "github.com/JuliaDocs/Documenter.jl.git",
    target = "build",
    deps = nothing,
    make = nothing,
)

@nalimilan
Copy link
Contributor Author

Looks great. We should probably wait for Build Stages to be out of beta status, and then recommend it?

@mortenpi
Copy link
Member

Yup, that was partially why I didn't go much further than just playing with it at the time.

@mforets
Copy link
Contributor

mforets commented Dec 14, 2017

Hello,

Thanks for this great documentation generator that we extensively use in our projects.

But you can also just run Documenter in your tests (i.e. have the include() in test/runtests.jl) if you'd like them to fail when deployment fails.

Would you mind extending a tiny bit on this approach? Which include() should I use here?

@mortenpi
Copy link
Member

Would you mind extending a tiny bit on this approach? Which include() should I use here?

Just include("../docs/make.jl) in runtests.jl (Documenter itself does it, actually). I would suggest looking into build stages though.. they are still officially beta, but my guess is that they are here to stay and the basic interface won't change.

@mforets
Copy link
Contributor

mforets commented Dec 28, 2017

Thanks for your reply. I tried with your example and it understands the "Deploy Docs job", but there are many fails (on purpose) and it still gives the green tick. Details here

@mortenpi
Copy link
Member

This is now the recommended way and has been documented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants