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 docs a project and run as a Travis job #131

Merged
merged 2 commits into from
Sep 13, 2018
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -3,3 +3,4 @@
*.jl.mem
docs/build
docs/src/examples/generated
/docs/Manifest.toml
21 changes: 12 additions & 9 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,17 @@ julia:
matrix:
allow_failures:
- julia: nightly
# Workaround for https://github.com/travis-ci/travis-ci/issues/4942
git:
depth: 99999
notifications:
email: false
# uncomment the following lines to override the default test script
# script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia -e 'using Pkg; Pkg.clone(pwd()); Pkg.test("LineSearches", coverage=true)'
email: false
sudo: false
jobs:
include:
- stage: "Documentation"
julia: 1.0
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.instantiate(); Pkg.add(PackageSpec(path=pwd()))'
- julia --project=docs/ docs/make.jl
after_success: skip
after_success:
- julia -e 'using Pkg; cd(Pkg.dir("LineSearches")); Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
- julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Codecov.submit(process_folder())'
9 changes: 9 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
LineSearches = "d3d80556-e9d4-5f37-9878-2ab0fcc64255"
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
Optim = "429524aa-4258-5aef-a3af-852621145aeb"
OptimTestProblems = "cec144fc-5a64-5bc6-99fb-dde8f63e154c"

[compat]
Documenter = "~0.19"
2 changes: 1 addition & 1 deletion docs/generate.jl
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ ONLYSTATIC = []

EXAMPLEDIR = joinpath(@__DIR__, "src", "examples")
GENERATEDDIR = joinpath(@__DIR__, "src", "examples", "generated")
myfilter(str) = occursin(r"\.jl$", str)
myfilter(str) = endswith(str, ".jl")
for example in filter!(myfilter, readdir(EXAMPLEDIR))
input = abspath(joinpath(EXAMPLEDIR, example))
script = Literate.script(input, GENERATEDDIR)
Expand Down
5 changes: 5 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,8 @@
if Base.HOME_PROJECT[] !== nothing
# JuliaLang/julia/pull/28625
Base.HOME_PROJECT[] = abspath(Base.HOME_PROJECT[])
end

using Documenter, LineSearches

# Generate examples
Expand Down
2 changes: 0 additions & 2 deletions test/REQUIRE
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
OptimTestProblems
#DoubleFloats
Documenter
Literate 0.2.0
Optim 0.16
5 changes: 0 additions & 5 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,3 @@ for my_test in my_tests
println("\n * $(my_test)")
@time include(my_test)
end

# Build the docs
if get(ENV, "TRAVIS_OS_NAME", "") == "linux" && get(ENV, "TRAVIS_JULIA_VERSION", "") == "1.0"
include(joinpath(@__DIR__, "../docs/make.jl"))
end