Skip to content

Commit ee5ba0e

Browse files
authored
CI: run doctests to catch regressions; test against Julia LTS; allow julia-actions/cache to cleanup caches (#931)
* CI: run doctests to catch regressions Run it only against the Julia LTS release, as outputs may differ between Julia releases. * CI: allow julia-actions/cache to cleanup caches * CI: also tweak documenter.yml permissions
1 parent 09bee73 commit ee5ba0e

File tree

3 files changed

+24
-4
lines changed

3 files changed

+24
-4
lines changed

.github/workflows/CI.yml

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,11 @@ concurrency:
1313
# Cancel intermediate builds, but only if it is a pull request build.
1414
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}
1515

16+
# needed to allow julia-actions/cache to delete old caches that it has created
17+
permissions:
18+
actions: write
19+
contents: read
20+
1621
jobs:
1722
test:
1823
name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }}
@@ -22,6 +27,7 @@ jobs:
2227
matrix:
2328
version:
2429
- '1.6'
30+
- 'lts'
2531
- '1'
2632
# - 'nightly'
2733
os:
@@ -48,6 +54,17 @@ jobs:
4854
- uses: julia-actions/cache@v2
4955
- uses: julia-actions/julia-buildpkg@v1
5056
- uses: julia-actions/julia-runtest@v1
57+
- name: "Run doctests"
58+
if: ${{ matrix.version == 'lts' }} # only run in one Julia version due to fluctuations
59+
run: |
60+
julia --project=docs --color=yes --code-coverage -e '
61+
using Pkg
62+
Pkg.develop(PackageSpec(path=pwd()))
63+
Pkg.instantiate()
64+
using Documenter
65+
using DataStructures
66+
DocMeta.setdocmeta!(DataStructures, :DocTestSetup, :(using DataStructures); recursive=true)
67+
doctest(DataStructures)'
5168
- uses: julia-actions/julia-processcoverage@v1
5269
- uses: codecov/codecov-action@v5
5370
with:

.github/workflows/Documenter.yml

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -5,11 +5,13 @@ on:
55
tags: [v*]
66
pull_request:
77

8+
permissions:
9+
actions: write # needed to allow julia-actions/cache to delete old caches that it has created
10+
contents: write # needed to allow deploying docs
11+
statuses: write
12+
813
jobs:
914
Documenter:
10-
permissions:
11-
contents: write
12-
statuses: write
1315
name: Documentation
1416
runs-on: ubuntu-latest
1517
steps:
@@ -18,7 +20,7 @@ jobs:
1820
with:
1921
version: '1' # replace this with whatever version you need
2022
show-versioninfo: true # this causes versioninfo to be printed to the action log
21-
- uses: julia-actions/cache@v2 # cache using https://github.com/julia-actions/cache
23+
- uses: julia-actions/cache@v2 # cache using https://github.com/julia-actions/cache
2224
- uses: julia-actions/julia-buildpkg@v1 # if package requires Pkg.build()
2325
- uses: julia-actions/julia-docdeploy@v1
2426
env:

docs/make.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ DocMeta.setdocmeta!(DataStructures, :DocTestSetup, :(using DataStructures); recu
66
makedocs(
77
sitename = "DataStructures.jl",
88
warnonly = true, # FIXME: address all warnings and resolve them
9+
doctest = true,
910
pages = [
1011
"index.md",
1112
"deque.md",

0 commit comments

Comments
 (0)