|
47 | 47 | - uses: codecov/codecov-action@v1
|
48 | 48 | with:
|
49 | 49 | file: lcov.info
|
50 |
| - docs: |
51 |
| - name: Documentation |
52 |
| - runs-on: ubuntu-latest |
53 |
| - steps: |
54 |
| - - uses: actions/checkout@v2 |
55 |
| - - uses: julia-actions/setup-julia@v1 |
56 |
| - with: |
57 |
| - 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 MLJBase |
103 |
| - @info "attempting to run the doctests" |
104 |
| - doctest(MLJBase) |
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' |
116 |
| - env: |
117 |
| - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} |
118 |
| - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} |
0 commit comments