Skip to content

Commit 1786647

Browse files
committed
Only run doctests on one version
1 parent 822ede6 commit 1786647

File tree

3 files changed

+58
-8
lines changed

3 files changed

+58
-8
lines changed

.github/workflows/CI.yml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -44,6 +44,8 @@ jobs:
4444
- uses: julia-actions/julia-buildpkg@v1
4545

4646
- uses: julia-actions/julia-runtest@v1
47+
env:
48+
GROUP: Tests
4749

4850
- uses: julia-actions/julia-processcoverage@v1
4951

.github/workflows/DocTests.yml

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
# We want to only run doctests on a single version of Julia, because
2+
# things like error messages / output can change between versions and
3+
# is fragile to test against.
4+
name: Doctests
5+
6+
on:
7+
push:
8+
branches:
9+
- main
10+
pull_request:
11+
merge_group:
12+
types: [checks_requested]
13+
14+
# needed to allow julia-actions/cache to delete old caches that it has created
15+
permissions:
16+
actions: write
17+
contents: read
18+
19+
# Cancel existing tests on the same PR if a new commit is added to a pull request
20+
concurrency:
21+
group: ${{ github.workflow }}-${{ github.ref || github.run_id }}
22+
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
23+
24+
jobs:
25+
test:
26+
runs-on: ubuntu-latest
27+
28+
steps:
29+
- uses: actions/checkout@v4
30+
31+
- uses: julia-actions/setup-julia@v2
32+
with:
33+
version: '1'
34+
35+
- uses: julia-actions/cache@v2
36+
37+
- uses: julia-actions/julia-buildpkg@v1
38+
39+
- uses: julia-actions/julia-runtest@v1
40+
env:
41+
GROUP: Doctests

test/runtests.jl

Lines changed: 15 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,21 @@ using AbstractPPL
1010
using Documenter
1111
using Test
1212

13+
const GROUP = get(ENV, "GROUP", "All")
14+
1315
@testset "AbstractPPL.jl" begin
14-
include("deprecations.jl")
15-
include("varname.jl")
16-
include("abstractprobprog.jl")
17-
@testset "doctests" begin
18-
DocMeta.setdocmeta!(
19-
AbstractPPL, :DocTestSetup, :(using AbstractPPL); recursive=true
20-
)
21-
doctest(AbstractPPL; manual=false)
16+
if GROUP == "All" || GROUP == "Tests"
17+
include("deprecations.jl")
18+
include("varname.jl")
19+
include("abstractprobprog.jl")
20+
end
21+
22+
if GROUP == "All" || GROUP == "Doctests"
23+
@testset "doctests" begin
24+
DocMeta.setdocmeta!(
25+
AbstractPPL, :DocTestSetup, :(using AbstractPPL); recursive=true
26+
)
27+
doctest(AbstractPPL; manual=false)
28+
end
2229
end
2330
end

0 commit comments

Comments
 (0)