Browse Source

test

pull/75/head
Fredrik Ekre 6 years ago
parent
commit
585890fe83
  1. 58
      .appveyor.yml
  2. 64
      .travis.yml
  3. 126
      docs/make.jl

58
.appveyor.yml

@ -1,36 +1,36 @@
environment: # environment:
matrix: # matrix:
- julia_version: 1.2 # - julia_version: 1.2
# - julia_version: latest # # - julia_version: latest
platform: # platform:
- x86 # 32-bit # - x86 # 32-bit
- x64 # 64-bit # - x64 # 64-bit
## uncomment the following lines to allow failures on nightly julia # ## uncomment the following lines to allow failures on nightly julia
## (tests will run but not make your overall status red) # ## (tests will run but not make your overall status red)
#matrix: # #matrix:
# allow_failures: # # allow_failures:
# - julia_version: latest # # - julia_version: latest
branches: # branches:
only: # only:
- master # - master
- /release-.*/ # - /release-.*/
notifications: # notifications:
- provider: Email # - provider: Email
on_build_success: false # on_build_success: false
on_build_failure: false # on_build_failure: false
on_build_status_changed: false # on_build_status_changed: false
install: # install:
- ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1")) # - ps: iex ((new-object net.webclient).DownloadString("https://raw.githubusercontent.com/JuliaCI/Appveyor.jl/version-1/bin/install.ps1"))
build_script: # build_script:
- echo "%JL_BUILD_SCRIPT%" # - echo "%JL_BUILD_SCRIPT%"
- C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%" # - C:\julia\bin\julia -e "%JL_BUILD_SCRIPT%"
test_script: # test_script:
- echo "%JL_TEST_SCRIPT%" # - echo "%JL_TEST_SCRIPT%"
- C:\julia\bin\julia -e "%JL_TEST_SCRIPT%" # - C:\julia\bin\julia -e "%JL_TEST_SCRIPT%"

64
.travis.yml

@ -1,32 +1,32 @@
## Documentation: http://docs.travis-ci.com/user/languages/julia/ # ## Documentation: http://docs.travis-ci.com/user/languages/julia/
language: julia # language: julia
os: # os:
- linux # - linux
- osx # - osx
julia: # julia:
- 1.0 # - 1.0
- 1.2 # - 1.2
- 1.3 # - 1.3
- nightly # - nightly
branches: # branches:
only: # only:
- master # - master
- /^v\d+\.\d+(\.\d+)?(-\S*)?$/ # - /^v\d+\.\d+(\.\d+)?(-\S*)?$/
after_success: # after_success:
- if [[ $TRAVIS_JULIA_VERSION = 1.2 ]] && [[ $TRAVIS_OS_NAME = linux ]]; then # - if [[ $TRAVIS_JULIA_VERSION = 1.2 ]] && [[ $TRAVIS_OS_NAME = linux ]]; then
julia --project=test/coverage -e 'using Pkg; Pkg.instantiate(); # julia --project=test/coverage -e 'using Pkg; Pkg.instantiate();
using Coverage; Codecov.submit(Codecov.process_folder())'; # using Coverage; Codecov.submit(Codecov.process_folder())';
fi # fi
# jobs: # # jobs:
# include: # # include:
# - stage: Documentation # # - stage: Documentation
# julia: 1.2 # # julia: 1.2
# os: linux # # os: linux
# script: # # script:
# - julia --project=docs -e 'using Pkg; Pkg.instantiate()' # # - julia --project=docs -e 'using Pkg; Pkg.instantiate()'
# - julia --project=docs --color=yes docs/make.jl # # - julia --project=docs --color=yes docs/make.jl
# after_success: skip # # after_success: skip
notifications: # notifications:
email: false # email: false
git: # git:
depth: 99999999 # depth: 99999999

126
docs/make.jl

@ -1,71 +1,91 @@
using Documenter using Documenter
using Literate using Literate
using Plots # to not capture precompilation output # using Plots # to not capture precompilation output
# generate examples # # generate examples
EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl") # EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl")
OUTPUT = joinpath(@__DIR__, "src/generated") # OUTPUT = joinpath(@__DIR__, "src/generated")
function preprocess(str) # function preprocess(str)
str = replace(str, "MYVARIABLE" => "z") # str = replace(str, "MYVARIABLE" => "z")
str = replace(str, "MYVALUE" => "1.0 + 2.0im") # str = replace(str, "MYVALUE" => "1.0 + 2.0im")
return str # return str
end # end
Literate.markdown(EXAMPLE, OUTPUT, preprocess = preprocess) # Literate.markdown(EXAMPLE, OUTPUT, preprocess = preprocess)
Literate.notebook(EXAMPLE, OUTPUT, preprocess = preprocess) # Literate.notebook(EXAMPLE, OUTPUT, preprocess = preprocess)
Literate.script(EXAMPLE, OUTPUT, preprocess = preprocess) # Literate.script(EXAMPLE, OUTPUT, preprocess = preprocess)
# generate the example notebook for the documentation, keep in sync with outputformats.md # # generate the example notebook for the documentation, keep in sync with outputformats.md
Literate.markdown(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT; credit = false, name = "name") # Literate.markdown(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT; credit = false, name = "name")
Literate.notebook(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, name = "notebook") # Literate.notebook(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, name = "notebook")
Literate.script(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, credit = false) # Literate.script(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, credit = false)
# replace the link in outputformats.md # # replace the link in outputformats.md
travis_tag = get(ENV, "TRAVIS_TAG", "") # travis_tag = get(ENV, "TRAVIS_TAG", "")
folder = isempty(travis_tag) ? "latest" : travis_tag # folder = isempty(travis_tag) ? "latest" : travis_tag
url = "https://nbviewer.jupyter.org/github/fredrikekre/Literate.jl/blob/gh-pages/$(folder)/" # url = "https://nbviewer.jupyter.org/github/fredrikekre/Literate.jl/blob/gh-pages/$(folder)/"
if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true" # if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true"
str = read(joinpath(@__DIR__, "src/outputformats.md"), String) # str = read(joinpath(@__DIR__, "src/outputformats.md"), String)
str = replace(str, "[notebook.ipynb](generated/notebook.ipynb)." => "[notebook.ipynb]($(url)generated/notebook.ipynb).") # str = replace(str, "[notebook.ipynb](generated/notebook.ipynb)." => "[notebook.ipynb]($(url)generated/notebook.ipynb).")
write(joinpath(@__DIR__, "src/outputformats.md"), str) # write(joinpath(@__DIR__, "src/outputformats.md"), str)
end # end
makedocs( # makedocs(
format = Documenter.HTML( # format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true", # prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/custom.css"], # assets = ["assets/custom.css"],
), # ),
modules = [Literate], # modules = [Literate],
sitename = "Literate.jl", # sitename = "Literate.jl",
pages = Any[ # pages = Any[
"index.md", # "index.md",
"fileformat.md", # "fileformat.md",
"pipeline.md", # "pipeline.md",
"outputformats.md", # "outputformats.md",
"customprocessing.md", # "customprocessing.md",
"documenter.md", # "documenter.md",
"generated/example.md"] # "generated/example.md"]
) # )
############################################ ############################################
# Set up for pushing preview docs from PRs # # Set up for pushing preview docs from PRs #
############################################ ############################################
if haskey(ENV, "TRAVIS_PULL_REQUEST") && ENV["TRAVIS_PULL_REQUEST"] != "false" # if haskey(ENV, "TRAVIS_PULL_REQUEST") && ENV["TRAVIS_PULL_REQUEST"] != "false"
# @info "Pushing preview docs."
# PR = ENV["TRAVIS_PULL_REQUEST"]
# # Overwrite Documenter's function for generating the versions.js file
# foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file))
# Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing
# # Overwrite necessary environment variables to trick Documenter to deploy
# ENV["TRAVIS_PULL_REQUEST"] = "false"
# ENV["TRAVIS_BRANCH"] = "master"
# deploydocs(
# devurl = "preview-PR$(PR)",
# repo = "github.com/fredrikekre/Literate.jl.git",
# )
# exit(0)
# end
if get(ENV, "GITHUB_EVENT_NAME", nothing) == "pull_request"
@info "Pushing preview docs." @info "Pushing preview docs."
PR = ENV["TRAVIS_PULL_REQUEST"] @show ENV["GITHUB_REF"]
# Overwrite Documenter's function for generating the versions.js file @show ENV["GITHUB_ACTOR"]
foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file)) @show ENV["GITHUB_EVENT_PATH"]
Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing @show ENV["GITHUB_SHA"]
# Overwrite necessary environment variables to trick Documenter to deploy @show Literate.JSON.parsefile(ENV["GITHUB_EVENT_PATH"])
ENV["TRAVIS_PULL_REQUEST"] = "false" # PR = ENV["TRAVIS_PULL_REQUEST"]
ENV["TRAVIS_BRANCH"] = "master" # # Overwrite Documenter's function for generating the versions.js file
deploydocs( # foreach(Base.delete_method, methods(Documenter.Writers.HTMLWriter.generate_version_file))
devurl = "preview-PR$(PR)", # Documenter.Writers.HTMLWriter.generate_version_file(_, _) = nothing
repo = "github.com/fredrikekre/Literate.jl.git", # # Overwrite necessary environment variables to trick Documenter to deploy
) # ENV["TRAVIS_PULL_REQUEST"] = "false"
# ENV["TRAVIS_BRANCH"] = "master"
# deploydocs(
# devurl = "preview-PR$(PR)",
# repo = "github.com/fredrikekre/Literate.jl.git",
# )
exit(0) exit(0)
end end

Loading…
Cancel
Save