From 812c72dde5babea2da54b2b1e03dc14732e7af8c Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 31 Oct 2021 22:38:31 -0400 Subject: [PATCH 1/4] For consistency, use the same `.ci/test_and_change_uuid.jl` pattern that all of the other external stdlibs use --- .ci/test_and_change_uuid.jl | 28 ++++++++++++++++++++++++++++ .github/workflows/CI.yml | 5 +---- 2 files changed, 29 insertions(+), 4 deletions(-) create mode 100644 .ci/test_and_change_uuid.jl diff --git a/.ci/test_and_change_uuid.jl b/.ci/test_and_change_uuid.jl new file mode 100644 index 0000000..8a422fb --- /dev/null +++ b/.ci/test_and_change_uuid.jl @@ -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", + ), +) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 680d242..83c4abd 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -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 From b8ce0a2c2687bd495d5c19c829a85ab362370f42 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 31 Oct 2021 22:44:52 -0400 Subject: [PATCH 2/4] Add the `docs/Project.toml` file, and gitignore the `docs/Manifest.toml` file --- docs/.gitignore | 1 + docs/Project.toml | 5 +++++ 2 files changed, 6 insertions(+) create mode 100644 docs/.gitignore create mode 100644 docs/Project.toml diff --git a/docs/.gitignore b/docs/.gitignore new file mode 100644 index 0000000..ba39cc5 --- /dev/null +++ b/docs/.gitignore @@ -0,0 +1 @@ +Manifest.toml diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..1a6d309 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" + +[compat] +Documenter = "~0.27" From 084ba4d5fda2ddd2f04569baf9b311a160e2fd0e Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 31 Oct 2021 22:48:50 -0400 Subject: [PATCH 3/4] Add a CI job that runs the doctests --- .github/workflows/CI.yml | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 83c4abd..1c94b3f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -49,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)' From fd24a3720bee1a6cc93e361f5c94c607821e65b6 Mon Sep 17 00:00:00 2001 From: Dilum Aluthge Date: Sun, 31 Oct 2021 22:51:35 -0400 Subject: [PATCH 4/4] Fix the broken doctests --- docs/src/index.md | 6 ------ 1 file changed, 6 deletions(-) diff --git a/docs/src/index.md b/docs/src/index.md index 6adf999..31f376b 100644 --- a/docs/src/index.md +++ b/docs/src/index.md @@ -69,13 +69,7 @@ julia> digest!(ctx) 0xa3 0x57 0x92 - 0x5b - 0xc5 - 0xe1 ⋮ - 0x19 - 0xa0 - 0x1b 0x89 0x4f 0x59