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 the broken doctests, and add a CI job that runs the doctests #81

Merged
merged 4 commits into from
Nov 1, 2021
Merged
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
28 changes: 28 additions & 0 deletions .ci/test_and_change_uuid.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
@static if Base.VERSION >= v"1.6"
using TOML
using Test
else
using Pkg: TOML
using Test
end

# To generate the new UUID, we simply modify the first character of the original UUID
const original_uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
const new_uuid = "fa8e919c-243c-51af-8825-aaa63cd721ce"

# `@__DIR__` is the `.ci/` folder.
# Therefore, `dirname(@__DIR__)` is the repository root.
const project_filename = joinpath(dirname(@__DIR__), "Project.toml")

@testset "Test that the UUID is unchanged" begin
project_dict = TOML.parsefile(project_filename)
@test project_dict["uuid"] == original_uuid
end

write(
project_filename,
replace(
read(project_filename, String),
r"uuid = .*?\n" => "uuid = \"$(new_uuid)\"\n",
),
)
20 changes: 16 additions & 4 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,7 @@ jobs:
version: ${{ matrix.julia-version }}
# Alter the UUID so that we test this package instead of loading
# the version that is already built into a Julia's system image.
- name: alter UUID
shell: bash
run: |
sed -i'' -e 's/ea8e919c-243c-51af-8825-aaa63cd721ce/ea8e919c-243c-51af-8825-aaa63cd721cf/' Project.toml
- run: julia --color=yes .ci/test_and_change_uuid.jl
- uses: julia-actions/julia-buildpkg@v1
- uses: julia-actions/julia-runtest@v1
- uses: julia-actions/julia-processcoverage@v1
Expand All @@ -52,3 +49,18 @@ jobs:
- uses: codecov/codecov-action@v1
with:
file: lcov.info
doctests:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- uses: actions/checkout@v2
with:
persist-credentials: false
- uses: julia-actions/setup-julia@v1
with:
version: 'nightly'
- run: julia --color=yes .ci/test_and_change_uuid.jl
- run: julia --project=docs --color=yes -e 'using Pkg; Pkg.instantiate()'
- run: julia --project=docs --color=yes -e 'using Pkg; Pkg.develop(PackageSpec(path = pwd()))'
- name: Run doctests
run: julia --project=docs --color=yes -e 'import SHA; import Documenter; Documenter.doctest(SHA)'
1 change: 1 addition & 0 deletions docs/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Manifest.toml
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.27"
6 changes: 0 additions & 6 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,7 @@ julia> digest!(ctx)
0xa3
0x57
0x92
0x5b
0xc5
0xe1
0x19
0xa0
0x1b
0x89
0x4f
0x59
Expand Down