@@ -55,64 +55,14 @@ jobs:
5555 - uses : julia-actions/setup-julia@v1
5656 with :
5757 version : ' 1'
58- - run : |
59- julia -e '
60- function set_environment_variable(name::AbstractString, value::AbstractString)
61- github_env = ENV["GITHUB_ENV"]
62- touch(github_env)
63- open(github_env, "a") do io
64- println(io, "$(name)=$(value)")
65- end
66- end
67- event_name = "${{ github.event_name }}"
68- if event_name == "pull_request"
69- base_ref = "${{ github.base_ref }}"
70- head_ref = "${{ github.head_ref }}"
71- base_repository = "${{ github.repository }}"
72- head_repository = "${{ github.event.pull_request.head.repo.full_name }}"
73- build_docs = (base_ref == "master") && (head_ref == "dev") && (base_repository == head_repository)
74- elseif event_name == "push"
75- ref = "${{ github.ref }}"
76- build_docs = (ref == "refs/heads/master") || (startswith(ref, "refs/tags/"))
77- elseif event_name == "schedule"
78- build_docs = ref == "refs/heads/master"
79- elseif event_name == "workflow_dispatch"
80- build_docs = ref == "refs/heads/master"
81- else
82- build_docs = false
83- end
84- if build_docs
85- @info("We will build the docs")
86- set_environment_variable("BUILD_DOCS", "true")
87- else
88- @info("We will NOT build the docs")
89- set_environment_variable("BUILD_DOCS", "false")
90- end'
91- - run : |
92- julia --project=docs -e '
93- if ENV["BUILD_DOCS"] == "true"
94- using Pkg
95- Pkg.develop(PackageSpec(path=pwd()))
96- Pkg.instantiate()
97- end'
98- - run : |
99- julia --project=docs -e '
100- if ENV["BUILD_DOCS"] == "true"
101- using Documenter: doctest
102- using LearnAPI
103- @info "attempting to run the doctests"
104- doctest(LearnAPI)
105- else
106- @info "skipping the doctests"
107- end'
108- - run : julia --project=docs -e '
109- if ENV["BUILD_DOCS"] == "true"
110- @info "attempting to build the docs"
111- run(`julia --project=docs docs/make.jl`)
112- @info "successfully built the docs"
113- else
114- @info "skipping the docs build"
115- end'
58+ - uses : julia-actions/julia-buildpkg@v1
59+ - uses : julia-actions/julia-docdeploy@v1
11660 env :
11761 GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
11862 DOCUMENTER_KEY : ${{ secrets.DOCUMENTER_KEY }}
63+ - run : |
64+ julia --project=docs -e '
65+ using Documenter: DocMeta, doctest
66+ using LearnAPI
67+ DocMeta.setdocmeta!(LearnAPI, :DocTestSetup, :(using LearnAPI); recursive=true)
68+ doctest(LearnAPI)'
0 commit comments