From c10bc217671da88036817aa8f2fc7cdae9ae3644 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Mon, 17 Mar 2025 18:04:18 +0100 Subject: [PATCH 1/3] CI: run doctests to catch regressions Run it only against the Julia LTS release, as outputs may differ between Julia releases. --- .github/workflows/CI.yml | 12 ++++++++++++ docs/make.jl | 1 + 2 files changed, 13 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 4e31f9f0..7d192e03 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -22,6 +22,7 @@ jobs: matrix: version: - '1.6' + - 'lts' - '1' # - 'nightly' os: @@ -48,6 +49,17 @@ jobs: - uses: julia-actions/cache@v2 - uses: julia-actions/julia-buildpkg@v1 - uses: julia-actions/julia-runtest@v1 + - name: "Run doctests" + if: ${{ matrix.version == 'lts' }} # only run in one Julia version due to fluctuations + run: | + julia --project=docs --color=yes --code-coverage -e ' + using Pkg + Pkg.develop(PackageSpec(path=pwd())) + Pkg.instantiate() + using Documenter + using DataStructures + DocMeta.setdocmeta!(DataStructures, :DocTestSetup, :(using DataStructures); recursive=true) + doctest(DataStructures)' - uses: julia-actions/julia-processcoverage@v1 - uses: codecov/codecov-action@v5 with: diff --git a/docs/make.jl b/docs/make.jl index 5656f41d..5425b03e 100644 --- a/docs/make.jl +++ b/docs/make.jl @@ -6,6 +6,7 @@ DocMeta.setdocmeta!(DataStructures, :DocTestSetup, :(using DataStructures); recu makedocs( sitename = "DataStructures.jl", warnonly = true, # FIXME: address all warnings and resolve them + doctest = true, pages = [ "index.md", "deque.md", From d6b87d2c658c8a2c2ee3d155a19c45e72c9992d1 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 18 Mar 2025 09:33:10 +0100 Subject: [PATCH 2/3] CI: allow julia-actions/cache to cleanup caches --- .github/workflows/CI.yml | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 7d192e03..13a3ef30 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -13,6 +13,11 @@ concurrency: # Cancel intermediate builds, but only if it is a pull request build. cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} +# needed to allow julia-actions/cache to delete old caches that it has created +permissions: + actions: write + contents: read + jobs: test: name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - ${{ github.event_name }} From 63b1e9b19f18cc11c5d01b8348c295a2c7082122 Mon Sep 17 00:00:00 2001 From: Max Horn Date: Tue, 18 Mar 2025 09:34:53 +0100 Subject: [PATCH 3/3] CI: also tweak documenter.yml permissions --- .github/workflows/Documenter.yml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/.github/workflows/Documenter.yml b/.github/workflows/Documenter.yml index 5f7ba8b7..c151bf89 100644 --- a/.github/workflows/Documenter.yml +++ b/.github/workflows/Documenter.yml @@ -5,11 +5,13 @@ on: tags: [v*] pull_request: +permissions: + actions: write # needed to allow julia-actions/cache to delete old caches that it has created + contents: write # needed to allow deploying docs + statuses: write + jobs: Documenter: - permissions: - contents: write - statuses: write name: Documentation runs-on: ubuntu-latest steps: @@ -18,7 +20,7 @@ jobs: with: version: '1' # replace this with whatever version you need show-versioninfo: true # this causes versioninfo to be printed to the action log - - uses: julia-actions/cache@v2 # cache using https://github.com/julia-actions/cache + - uses: julia-actions/cache@v2 # cache using https://github.com/julia-actions/cache - uses: julia-actions/julia-buildpkg@v1 # if package requires Pkg.build() - uses: julia-actions/julia-docdeploy@v1 env: