Skip to content

Commit

Permalink
project-base docs and coverage deployment (#27)
Browse files Browse the repository at this point in the history
Project-base docs and coverage deployment.
  • Loading branch information
tpapp authored Nov 27, 2018
1 parent 45138ad commit f5b83de
Show file tree
Hide file tree
Showing 7 changed files with 41 additions and 31 deletions.
44 changes: 22 additions & 22 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -1,31 +1,31 @@
# Documentation: http://docs.travis-ci.com/user/languages/julia/
## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia
os:
- linux
# - osx
# - osx
julia:
- 1.0
- nightly
notifications:
email: false
matrix:
allow_failures:
- julia: nightly
# uncomment the following lines for debugging Documenter.jl
# env:
# - DOCUMENTER_DEBUG=true
before_script:
# install unregistered dependencies (FIXME remove when they are registered)
- julia -e 'using Pkg; pkg"resolve"'
# uncomment the following lines to override the default test script
# script:
# - if [[ -a .git/shallow ]]; then git fetch --unshallow; fi
# - julia test-script.jl
git:
depth: 99999999

## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red)
#matrix:
# allow_failures:
# - julia: nightly

jobs:
include:
- stage: Documentation
julia: 1.0
os: linux
script:
- julia --project=docs -e 'using Pkg; Pkg.instantiate(); Pkg.develop(PackageSpec(path=pwd()))'
- julia --project=docs --color=yes docs/make.jl
after_success: skip
after_success:
# push coverage results to Coveralls
- julia -e 'import Pkg; cd(Pkg.dir("DynamicHMC")); Pkg.add("Coverage"); using Coverage; Coveralls.submit(Coveralls.process_folder())'
# push coverage results to Codecov
- julia -e 'import Pkg; cd(Pkg.dir("DynamicHMC")); Pkg.add("Coverage"); using Coverage; Codecov.submit(Codecov.process_folder())'
# build documentation
- julia -e 'import Pkg; ps=Pkg.PackageSpec(name="Documenter", version="0.19"); Pkg.add(ps); Pkg.pin(ps)'
- julia -e 'import Pkg; cd(Pkg.dir("DynamicHMC")); include(joinpath("docs", "make.jl"))'
- julia --project=test/coverage -e 'using Pkg; Pkg.instantiate()'
- julia --project=test/coverage test/coverage/coverage.jl
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Bare-bones implementation of robust dynamic Hamiltonian Monte Carlo methods.
[![Build Status](https://travis-ci.org/tpapp/DynamicHMC.jl.svg?branch=master)](https://travis-ci.org/tpapp/DynamicHMC.jl)
[![Coverage Status](https://coveralls.io/repos/tpapp/DynamicHMC.jl/badge.svg?branch=master&service=github)](https://coveralls.io/github/tpapp/DynamicHMC.jl?branch=master)
[![codecov.io](http://codecov.io/github/tpapp/DynamicHMC.jl/coverage.svg?branch=master)](http://codecov.io/github/tpapp/DynamicHMC.jl?branch=master)
[![Documentation](https://img.shields.io/badge/docs-latest-blue.svg)](https://tpapp.github.io/DynamicHMC.jl/latest)
[![Documentation](https://img.shields.io/badge/docs-dev-blue.svg)](https://tpapp.github.io/DynamicHMC.jl/dev)

## Overview

Expand Down
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.20"
8 changes: 2 additions & 6 deletions docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,11 @@ makedocs(modules = [DynamicHMC],
clean = true,
sitename = "DynamicHMC.jl",
authors = "Tamás K. Papp",
html_prettyurls = haskey(ENV, "TRAVIS"), # clean URLs building on Travis
checkdocs = :exports,
pages = [
"Overview" => "index.md",
"High-level API" => "api.md",
"Low-level building blocks" => "lowlevel.md",
])

deploydocs(repo = "github.com/tpapp/DynamicHMC.jl.git",
target = "build",
deps = nothing,
make = nothing,
julia = "1.0")
deploydocs(repo = "github.com/tpapp/DynamicHMC.jl.git")
2 changes: 2 additions & 0 deletions test/coverage/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
[deps]
Coverage = "a2441757-f6aa-5fb2-8edb-039e3f45d037"
9 changes: 9 additions & 0 deletions test/coverage/coverage.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# only push coverage from one bot
get(ENV, "TRAVIS_OS_NAME", nothing) == "linux" || exit(0)
get(ENV, "TRAVIS_JULIA_VERSION", nothing) == "1.0" || exit(0)

using Coverage

cd(joinpath(@__DIR__, "..", "..")) do
Codecov.submit(Codecov.process_folder())
end
2 changes: 0 additions & 2 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -129,5 +129,3 @@ end
@include_testset("test-normal-mcmc.jl")
@include_testset("test-statistics.jl")
@include_testset("test-reporting.jl")

include("../docs/make.jl")

0 comments on commit f5b83de

Please sign in to comment.