Skip to content

Commit

Permalink
Update
Browse files Browse the repository at this point in the history
  • Loading branch information
Heptazhou committed Apr 7, 2024
1 parent fba2f66 commit a28f97f
Show file tree
Hide file tree
Showing 9 changed files with 97 additions and 10 deletions.
20 changes: 17 additions & 3 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,6 @@ jobs:
- "1.6"
- "1"
- "nightly"
exclude:
- os: macos-latest
julia-version: nightly
steps:
- uses: actions/checkout@v4
with:
Expand All @@ -47,3 +44,20 @@ jobs:
- uses: codecov/[email protected]
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 }}
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

/docs/build/
lcov.info
Manifest.toml
7 changes: 0 additions & 7 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
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"
OrderedCollections = "bac558e1-5e72-5ebc-8fee-abe8a469f55d"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
30 changes: 30 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -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 = Documenter.getremote(@__DIR__),
)

5 changes: 5 additions & 0 deletions docs/src/api.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
## API reference
```@autodocs
Modules = [UUID4]
```

21 changes: 21 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -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]
```

5 changes: 5 additions & 0 deletions test/Project.toml
Original file line number Diff line number Diff line change
@@ -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"
13 changes: 13 additions & 0 deletions test/runtests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit a28f97f

Please sign in to comment.