From 77c9cf40372a94c828025b801d68ceb800bad971 Mon Sep 17 00:00:00 2001 From: Milan Bouchet-Valat Date: Mon, 15 Apr 2019 19:50:11 +0200 Subject: [PATCH] Use project to build Documenter docs (#480) * Use project to build Documenter docs This should also fix building the docs, which haven't been deployed for one year. * Fix --- .travis.yml | 12 +++++++++++- docs/Project.toml | 5 +++++ docs/make.jl | 14 +++++++------- 3 files changed, 23 insertions(+), 8 deletions(-) create mode 100644 docs/Project.toml diff --git a/.travis.yml b/.travis.yml index 9819b41076e3e5..0197a78b946f14 100644 --- a/.travis.yml +++ b/.travis.yml @@ -17,4 +17,14 @@ git: # - julia -e 'Pkg.clone(pwd()); Pkg.build("StatsBase"); Pkg.test("StatsBase"; coverage=true)' after_success: - julia -e 'using Pkg; Pkg.add("Coverage"); using Coverage; Coveralls.submit(process_folder()); Codecov.submit(process_folder())'; - - julia -e 'using Pkg; Pkg.add("Documenter"); include(joinpath("docs", "make.jl"))' +jobs: + include: + - stage: "Documentation" + julia: 1.0 + os: linux + script: + - julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); + Pkg.instantiate()' + - julia --project=docs/ docs/make.jl + after_success: skip + diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 00000000000000..cb418284028b45 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "~0.22" diff --git a/docs/make.jl b/docs/make.jl index 718a2186e3f70f..8371203129163d 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -1,7 +1,11 @@ using Documenter, StatsBase, Statistics, Random +# Workaround for JuliaLang/julia/pull/28625 +if Base.HOME_PROJECT[] !== nothing + Base.HOME_PROJECT[] = abspath(Base.HOME_PROJECT[]) +end + makedocs( - format = :html, sitename = "StatsBase.jl", modules = [StatsBase], pages = ["index.md", @@ -23,9 +27,5 @@ makedocs( ) deploydocs( - repo = "github.com/JuliaStats/StatsBase.jl.git", - target = "build", - julia = "1.0", - deps = nothing, - make = nothing -) + repo = "github.com/JuliaStats/StatsBase.jl.git" +) \ No newline at end of file