diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 43e8ecd..10fc1aa 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -28,9 +28,6 @@ jobs: - "1.6" - "1" - "nightly" - exclude: - - os: macos-latest - julia-version: nightly steps: - uses: actions/checkout@v4 with: @@ -47,3 +44,20 @@ jobs: - uses: codecov/codecov-action@v3.1.5 with: file: lcov.info + docs: + runs-on: ubuntu-latest + timeout-minutes: 10 + permissions: + contents: write + statuses: write + steps: + - uses: actions/checkout@v4 + with: + persist-credentials: false + - uses: julia-actions/setup-julia@v2 + with: + show-versioninfo: true + version: "1" + - uses: julia-actions/julia-docdeploy@v1 + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} diff --git a/.gitignore b/.gitignore index 214f83f..afc880f 100644 --- a/.gitignore +++ b/.gitignore @@ -1,3 +1,4 @@ +/docs/build/ lcov.info Manifest.toml diff --git a/Project.toml b/Project.toml index adff298..5ee3c29 100644 --- a/Project.toml +++ b/Project.toml @@ -5,10 +5,3 @@ version = "1.10.0" [deps] Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" - -[extras] -OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" -Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" - -[targets] -test = ["OrderedCollections", "Test"] diff --git a/docs/Project.toml b/docs/Project.toml new file mode 100644 index 0000000..d0c1130 --- /dev/null +++ b/docs/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/docs/make.jl b/docs/make.jl new file mode 100644 index 0000000..8e37b30 --- /dev/null +++ b/docs/make.jl @@ -0,0 +1,30 @@ +using Documenter: Documenter, DocMeta +using UUID4 + +DocMeta.setdocmeta!(UUID4, :DocTestSetup, quote +#! format: noindent +using OrderedCollections +using UUID4 +end) + +@info "doctest" +Documenter.doctest(UUID4, fix = true, manual = false) + +@info "makedocs" +Documenter.makedocs( + doctest = false, + format = Documenter.HTML(), + modules = [UUID4], + pages = ["Manual" => "index.md"], + pagesonly = true, + sitename = "UUID4.jl", +) + +@info "deploydocs" +Documenter.deploydocs( + devbranch = "master", + devurl = "latest", + forcepush = true, + repo = "github.com/0h7z/UUID4.jl.git", +) + diff --git a/docs/src/api.md b/docs/src/api.md new file mode 100644 index 0000000..a10c65c --- /dev/null +++ b/docs/src/api.md @@ -0,0 +1,5 @@ +## API reference +```@autodocs +Modules = [UUID4] +``` + diff --git a/docs/src/index.md b/docs/src/index.md new file mode 100644 index 0000000..8a55678 --- /dev/null +++ b/docs/src/index.md @@ -0,0 +1,21 @@ +# UUID4.jl +[![CI status](https://github.com/0h7z/UUID4.jl/actions/workflows/CI.yml/badge.svg)](https://github.com/0h7z/UUID4.jl/actions/workflows/CI.yml) +[![codecov.io](https://codecov.io/gh/0h7z/UUID4.jl/branch/master/graph/badge.svg)](https://app.codecov.io/gh/0h7z/UUID4.jl) + +***** +## Usage +```julia +pkg> registry add https://github.com/0h7z/0hjl.git +pkg> add UUID4 + +julia> using UUID4 +help?> UUID4 +help?> uuid +``` + +***** +## API reference +```@autodocs +Modules = [UUID4] +``` + diff --git a/test/Project.toml b/test/Project.toml new file mode 100644 index 0000000..d0c1130 --- /dev/null +++ b/test/Project.toml @@ -0,0 +1,5 @@ +[deps] +Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" +OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d" +Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c" +Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" diff --git a/test/runtests.jl b/test/runtests.jl index 0591ec4..9d7bbb4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -17,6 +17,19 @@ using OrderedCollections: LittleDict, OrderedDict using Random: Random using Test, UUID4 +parse(Bool, get(ENV, "CI", "0")) || cd(@__DIR__) do + cp("./Project.toml", "../docs/Project.toml", force = true) + fs = [ + "../README.md" + "../docs/src/api.md" + ] + md = join(readchomp.(fs), "\n$("*"^5)\n") + md = replace(md, r"^#+\K\s+"m => " ") + write("../docs/src/index.md", md, "\n") + + include("../docs/make.jl") +end + u4 = uuid4() @test 4 == uuid_version(u4) @test 4 == uuid_version(u4 |> string)