Skip to content

Commit

Permalink
wip: monkeypatch documenter into printing blocks and timings
Browse files Browse the repository at this point in the history
and just run doctests for now...
  • Loading branch information
benlorenz committed Jul 24, 2023
1 parent aa4d50d commit 0614ae4
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 60 deletions.
61 changes: 1 addition & 60 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,57 +15,6 @@ concurrency:
cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }}

jobs:
test:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
continue-on-error: ${{ matrix.julia-version == 'nightly' }}
strategy:
fail-fast: false
matrix:
julia-version:
- '1.6'
- '1.9'
- '~1.10.0-0'
- 'nightly'
os:
- ubuntu-latest
include:
# Add a few macOS jobs (not too many, the number we can run in parallel is limited)
- julia-version: 'nightly'
os: macOS-latest

steps:
- uses: actions/checkout@v3
with:
# For Codecov, we must also fetch the parent of the HEAD commit to
# be able to properly deal with PRs / merges
fetch-depth: 2
- name: "Set up Julia"
uses: julia-actions/setup-julia@v1
with:
version: ${{ matrix.julia-version }}
- name: "Build package"
uses: julia-actions/julia-buildpkg@latest
- name: "limit OpenMP threads"
if: runner.os == 'macOS'
# restrict number of openMP threads on macOS due to oversubscription
run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
- name: "Run tests"
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
- name: "Process code coverage"
if: matrix.julia-version == '1.9'
uses: julia-actions/julia-processcoverage@v1
with:
directories: src,experimental
- name: "Upload coverage data to Codecov"
if: matrix.julia-version == '1.9'
continue-on-error: true
uses: codecov/codecov-action@v3

doctest:
runs-on: ${{ matrix.os }}
timeout-minutes: 150
Expand Down Expand Up @@ -100,15 +49,6 @@ jobs:
if: runner.os == 'macOS'
# restrict number of openMP threads on macOS due to oversubscription
run: echo "OMP_NUM_THREADS=1" >> $GITHUB_ENV
- name: "Run tests"
# HACK: since macOS runners are so expensive, we reuse this one to run
# both regular tests and doctests
if: runner.os == 'macOS'
uses: julia-actions/julia-runtest@latest
with:
annotate: ${{ matrix.julia-version == '1.9' }}
coverage: ${{ matrix.julia-version == '1.9' }}
depwarn: error
- name: "Setup package"
run: |
julia --project=docs --color=yes -e '
Expand All @@ -119,6 +59,7 @@ jobs:
run: |
julia --project=docs --depwarn=error --color=yes -e'
using Documenter
include("docs/documenter_helpers.jl")
using Oscar
DocMeta.setdocmeta!(Oscar, :DocTestSetup, :(using Oscar; Oscar.AbstractAlgebra.set_current_module(@__MODULE__)); recursive = true)
doctest(Oscar)'
Expand Down
7 changes: 7 additions & 0 deletions docs/documenter_helpers.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@


function Documenter.DocTests.eval_repl(block, sandbox::Module, meta::Dict, doc::Documenter.Documents.Document, page)
src_lines = Documenter.Utilities.find_block_in_file(block.code, meta[:CurrentFile])
println("page: $(Documenter.Utilities.locrepr(meta[:CurrentFile], src_lines))")
@time invoke(Documenter.DocTests.eval_repl, Tuple{Any,Any,Dict,Documenter.Documents.Document,Any}, block, sandbox, meta, doc, page)
end
2 changes: 2 additions & 0 deletions docs/make_work.jl
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ module BuildDoc

using Documenter, DocumenterCitations

include("documenter_helpers.jl")

# Overwrite printing to make the header not full of redundant nonsense
# Turns
# Hecke.Order - Method
Expand Down

0 comments on commit 0614ae4

Please sign in to comment.