Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix doctest script #19

Open
wants to merge 2 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 24 additions & 6 deletions .github/workflows/doctests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -4,20 +4,36 @@ on:
branches:
- 'main'
- /^release-.*$/
tags: '*'
tags: ['*']
pull_request:
jobs:
doctests:
name: Doctests (Julia ${{ matrix.julia-version }} - ${{ github.event_name }})
name: Doctests (Julia 1.6.2 - ${{ github.event_name }} - ${{ matrix.filter_mode }})
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
julia-version: [1.6.1]
include:
# We run and generate github suggestions on anywhere in the
# diff of the PR.
# We don't fail if there is a suggestion to make because we want
# to continue to the next step.
- fail_on_error: false
filter_mode: 'diff_context'

# We run once with no filter. That means we get
# "annotations" instead of suggestions (toggle them by pressing `a`
# while viewing the PR) and they can't be committed, but they can
# occur anywhere, not just in the diff of the PR. This time,
# we fail if there were any, because it means the doctests did not pass.
- fail_on_error: true
filter_mode: 'nofilter'

steps:
- uses: julia-actions/setup-julia@latest
with:
version: ${{ matrix.julia-version }}
- uses: actions/checkout@v1
version: 1.6.2
- uses: actions/checkout@v2
- name: Install dependencies
run: julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd())); Pkg.instantiate()'
- name: Fix doctests
Expand All @@ -26,8 +42,10 @@ jobs:
- uses: codecov/codecov-action@v1
with:
file: lcov.info
token: ${{ secrets.CODECOV_TOKEN }}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not needed for public repos I think:

Suggested change
token: ${{ secrets.CODECOV_TOKEN }}

- uses: reviewdog/action-suggester@v1
if: github.event_name == 'pull_request'
with:
tool_name: Documenter (doctests)
fail_on_error: true
fail_on_error: ${{ matrix.fail_on_error }}
filter_mode: ${{ matrix.filter_mode }}
2 changes: 1 addition & 1 deletion src/names.jl
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ true

julia> Tables.schema(Tables.rowtable(matches))
Tables.Schema:
:document Document{NamedTuple{(:document_name,),Tuple{String}}}
:document Document{NamedTuple{(:document_name,), Tuple{String}}}
:distance Int64
:indices UnitRange{Int64}
:query Query
Expand Down
2 changes: 1 addition & 1 deletion src/printing.jl
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ Corpus metadata: (name = "Lots of docs",)
julia> C2 = Corpus([Document("a")], (; a = 1));

julia> [C1, C2]
2-element Array{Corpus,1}:
2-element Vector{Corpus}:
Corpus with 2 documents, each with metadata keys: (:doc_idx,)
Corpus with 1 documents, each with metadata keys: ()

Expand Down