Skip to content

Commit 211b675

Browse files
gdalledevmotiongithub-actions[bot]
authored
Run CI on tags (#118)
* Run CI on tags * Split docs from tests * Update .github/workflows/Docs.yml Co-authored-by: David Widmann <[email protected]> * Add doctests to test suite * Update test/runtests.jl Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com> * Add Documenter compat for tests --------- Co-authored-by: David Widmann <[email protected]> Co-authored-by: github-actions[bot] <41898282+github-actions[bot]@users.noreply.github.com>
1 parent d36bb00 commit 211b675

File tree

4 files changed

+43
-30
lines changed

4 files changed

+43
-30
lines changed

Diff for: .github/workflows/CI.yml

+1-28
Original file line numberDiff line numberDiff line change
@@ -39,31 +39,4 @@ jobs:
3939
- uses: julia-actions/julia-processcoverage@v1
4040
- uses: codecov/codecov-action@v3
4141
with:
42-
files: lcov.info
43-
docs:
44-
name: Documentation
45-
runs-on: ubuntu-latest
46-
permissions:
47-
contents: write
48-
statuses: write
49-
steps:
50-
- uses: actions/checkout@v4
51-
- uses: julia-actions/setup-julia@v1
52-
with:
53-
version: '1'
54-
- name: Configure doc environment
55-
run: |
56-
julia --project=docs/ -e '
57-
using Pkg
58-
Pkg.develop(PackageSpec(path=pwd()))
59-
Pkg.instantiate()'
60-
- uses: julia-actions/julia-buildpkg@v1
61-
- uses: julia-actions/julia-docdeploy@v1
62-
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
64-
- run: |
65-
julia --project=docs -e '
66-
using Documenter: DocMeta, doctest
67-
using AbstractDifferentiation
68-
DocMeta.setdocmeta!(AbstractDifferentiation, :DocTestSetup, :(using AbstractDifferentiation); recursive=true)
69-
doctest(AbstractDifferentiation)'
42+
files: lcov.info

Diff for: .github/workflows/Docs.yml

+36
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
name: Docs
2+
3+
on:
4+
push:
5+
branches: [master]
6+
tags: '*'
7+
pull_request:
8+
9+
concurrency:
10+
# Skip intermediate builds: always.
11+
# Cancel intermediate builds: only if it is a pull request build.
12+
group: ${{ github.workflow }}-${{ github.ref }}
13+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
14+
15+
jobs:
16+
docs:
17+
name: Documentation
18+
runs-on: ubuntu-latest
19+
permissions:
20+
contents: write
21+
statuses: write
22+
steps:
23+
- uses: actions/checkout@v4
24+
- uses: julia-actions/setup-julia@v1
25+
with:
26+
version: '1'
27+
- uses: julia-actions/julia-buildpkg@v1
28+
- uses: julia-actions/julia-docdeploy@v1
29+
env:
30+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
31+
- run: |
32+
julia --project=docs -e '
33+
using Documenter: DocMeta, doctest
34+
using AbstractDifferentiation
35+
DocMeta.setdocmeta!(AbstractDifferentiation, :DocTestSetup, :(using AbstractDifferentiation); recursive=true)
36+
doctest(AbstractDifferentiation)'

Diff for: Project.toml

+3-1
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@ AbstractDifferentiationZygoteExt = "Zygote"
2929
[compat]
3030
ChainRulesCore = "1"
3131
DiffResults = "1"
32+
Documenter = "1"
3233
ExprTools = "0.1"
3334
FiniteDifferences = "0.12"
3435
ForwardDiff = "0.10"
@@ -41,6 +42,7 @@ julia = "1.6"
4142
[extras]
4243
ChainRulesCore = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
4344
DiffResults = "163ba53b-c6d8-5494-b064-1a9d43ac40c5"
45+
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
4446
FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
4547
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
4648
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
@@ -50,4 +52,4 @@ Tracker = "9f7883ad-71c0-57eb-9f7f-b5c9e6d3789c"
5052
Zygote = "e88e6eb3-aa80-5325-afca-941959d7151f"
5153

5254
[targets]
53-
test = ["Test", "ChainRulesCore", "DiffResults", "FiniteDifferences", "ForwardDiff", "Random", "ReverseDiff", "Tracker", "Zygote"]
55+
test = ["ChainRulesCore", "DiffResults", "Documenter", "FiniteDifferences", "ForwardDiff", "Random", "ReverseDiff", "Test", "Tracker", "Zygote"]

Diff for: test/runtests.jl

+3-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,9 @@
11
using AbstractDifferentiation
2+
using Documenter
23
using Test
34

4-
@testset "AbstractDifferentiation.jl" begin
5+
@testset verbose = true "AbstractDifferentiation.jl" begin
6+
doctest(AbstractDifferentiation)
57
include("test_utils.jl")
68
include("defaults.jl")
79
include("forwarddiff.jl")

0 commit comments

Comments
 (0)