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

64
.travis.yml

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

126
docs/make.jl

@ -1,71 +1,91 @@ @@ -1,71 +1,91 @@
using Documenter
using Literate
using Plots # to not capture precompilation output
# using Plots # to not capture precompilation output
# generate examples
EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl")
OUTPUT = joinpath(@__DIR__, "src/generated")
# # generate examples
# EXAMPLE = joinpath(@__DIR__, "..", "examples", "example.jl")
# OUTPUT = joinpath(@__DIR__, "src/generated")
function preprocess(str)
str = replace(str, "MYVARIABLE" => "z")
str = replace(str, "MYVALUE" => "1.0 + 2.0im")
return str
end
# function preprocess(str)
# str = replace(str, "MYVARIABLE" => "z")
# str = replace(str, "MYVALUE" => "1.0 + 2.0im")
# return str
# end
Literate.markdown(EXAMPLE, OUTPUT, preprocess = preprocess)
Literate.notebook(EXAMPLE, OUTPUT, preprocess = preprocess)
Literate.script(EXAMPLE, OUTPUT, preprocess = preprocess)
# Literate.markdown(EXAMPLE, OUTPUT, preprocess = preprocess)
# Literate.notebook(EXAMPLE, OUTPUT, preprocess = preprocess)
# Literate.script(EXAMPLE, OUTPUT, preprocess = preprocess)
# 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.notebook(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, name = "notebook")
Literate.script(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, credit = false)
# # 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.notebook(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, name = "notebook")
# Literate.script(joinpath(@__DIR__, "src/outputformats.jl"), OUTPUT, credit = false)
# replace the link in outputformats.md
travis_tag = get(ENV, "TRAVIS_TAG", "")
folder = isempty(travis_tag) ? "latest" : travis_tag
url = "https://nbviewer.jupyter.org/github/fredrikekre/Literate.jl/blob/gh-pages/$(folder)/"
if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true"
str = read(joinpath(@__DIR__, "src/outputformats.md"), String)
str = replace(str, "[notebook.ipynb](generated/notebook.ipynb)." => "[notebook.ipynb]($(url)generated/notebook.ipynb).")
write(joinpath(@__DIR__, "src/outputformats.md"), str)
end
# # replace the link in outputformats.md
# travis_tag = get(ENV, "TRAVIS_TAG", "")
# folder = isempty(travis_tag) ? "latest" : travis_tag
# url = "https://nbviewer.jupyter.org/github/fredrikekre/Literate.jl/blob/gh-pages/$(folder)/"
# if get(ENV, "HAS_JOSH_K_SEAL_OF_APPROVAL", "") == "true"
# str = read(joinpath(@__DIR__, "src/outputformats.md"), String)
# str = replace(str, "[notebook.ipynb](generated/notebook.ipynb)." => "[notebook.ipynb]($(url)generated/notebook.ipynb).")
# write(joinpath(@__DIR__, "src/outputformats.md"), str)
# end
makedocs(
format = Documenter.HTML(
prettyurls = get(ENV, "CI", nothing) == "true",
assets = ["assets/custom.css"],
# makedocs(
# format = Documenter.HTML(
# prettyurls = get(ENV, "CI", nothing) == "true",
# assets = ["assets/custom.css"],
),
modules = [Literate],
sitename = "Literate.jl",
pages = Any[
"index.md",
"fileformat.md",
"pipeline.md",
"outputformats.md",
"customprocessing.md",
"documenter.md",
"generated/example.md"]
)
# ),
# modules = [Literate],
# sitename = "Literate.jl",
# pages = Any[
# "index.md",
# "fileformat.md",
# "pipeline.md",
# "outputformats.md",
# "customprocessing.md",
# "documenter.md",
# "generated/example.md"]
# )
############################################
# 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."
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",
)
@show ENV["GITHUB_REF"]
@show ENV["GITHUB_ACTOR"]
@show ENV["GITHUB_EVENT_PATH"]
@show ENV["GITHUB_SHA"]
@show Literate.JSON.parsefile(ENV["GITHUB_EVENT_PATH"])
# 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

Loading…
Cancel
Save