Skip to content

Commit 0d336d4

Browse files
authored
Apply shared_docs_and_tests_workflows patch (#43)
1 parent 6d657d5 commit 0d336d4

8 files changed

Lines changed: 16 additions & 115 deletions

File tree

.github/workflows/Deploy.yml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,13 @@ jobs:
1616
version: "1"
1717
- name: "Install dependencies"
1818
run: |-
19-
julia --project=docs/ -e 'using Pkg; Pkg.develop(path="."); Pkg.instantiate()'
19+
julia --project=docs/ -e '
20+
import Pkg
21+
Pkg.Registry.add("General")
22+
Pkg.Registry.add(Pkg.RegistrySpec(; url="https://github.com/ITensor/ITensorRegistry.git"))
23+
Pkg.develop(path=".")
24+
Pkg.instantiate()
25+
'
2026
- name: "Aggregate and deploy"
2127
run: |
2228
git config user.name github-actions

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
name = "ITensorDocs"
22
uuid = "421c5ee2-4dae-4799-bb38-a6a9d9332403"
3-
version = "0.1.14"
3+
version = "0.1.15"
44
authors = ["ITensor developers <support@itensor.org> and contributors"]
55

66
[workspace]

docs/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
33
ITensorDocs = "421c5ee2-4dae-4799-bb38-a6a9d9332403"
4+
ITensorFormatter = "b6bf39f1-c9d3-4bad-aad8-593d802f65fd"
45
Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306"
56
MultiDocumenter = "87ed4bf0-c935-4a67-83c3-2a03bee4197c"
67

@@ -10,5 +11,6 @@ path = ".."
1011
[compat]
1112
Documenter = "1.9"
1213
ITensorDocs = "0.1"
14+
ITensorFormatter = "0.2.27"
1315
Literate = "2.20.1"
1416
MultiDocumenter = "0.8"

docs/make.jl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
# directory (as opposed to `docs/clones`).
99
using Documenter: Documenter
1010
using ITensorDocs: ITensorDocs
11+
using ITensorFormatter: ITensorFormatter
1112
using MultiDocumenter: MultiDocumenter
1213

1314
clonedir = ("--temp" in ARGS) ? mktempdir() : joinpath(@__DIR__, "clones")
@@ -18,7 +19,7 @@ Building aggregate site into: $(outpath)
1819
"""
1920

2021
@info "Building Documenter site for ITensorDocs"
21-
include("make_index.jl")
22+
ITensorFormatter.make_index!(pkgdir(ITensorDocs))
2223
Documenter.makedocs(;
2324
sitename = "ITensor ecosystem docs",
2425
modules = [ITensorDocs],

docs/make_index.jl

Lines changed: 0 additions & 21 deletions
This file was deleted.

docs/make_readme.jl

Lines changed: 0 additions & 17 deletions
This file was deleted.

test/Project.toml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
[deps]
22
Aqua = "4c88cf16-eb10-579e-8560-4a9242c79595"
33
ITensorDocs = "421c5ee2-4dae-4799-bb38-a6a9d9332403"
4+
ITensorPkgSkeleton = "3d388ab1-018a-49f4-ae50-18094d5f71ea"
45
SafeTestsets = "1bc83da4-3b8d-516f-aca4-4fe02f6d838f"
56
Suppressor = "fd094767-a336-5f1f-9728-57cf17d0bbfb"
67
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
@@ -11,6 +12,7 @@ path = ".."
1112
[compat]
1213
Aqua = "0.8.9"
1314
ITensorDocs = "0.1"
15+
ITensorPkgSkeleton = "0.3.42"
1416
SafeTestsets = "0.1"
1517
Suppressor = "0.2"
1618
Test = "1.10"

test/runtests.jl

Lines changed: 2 additions & 74 deletions
Original file line numberDiff line numberDiff line change
@@ -1,75 +1,3 @@
1-
using SafeTestsets: @safetestset
2-
using Suppressor: Suppressor
1+
using ITensorPkgSkeleton: ITensorPkgSkeleton
32

4-
# check for filtered groups
5-
# either via `--group=ALL` or through ENV["GROUP"]
6-
const pat = r"(?:--group=)(\w+)"
7-
arg_id = findfirst(contains(pat), ARGS)
8-
const GROUP = uppercase(
9-
if isnothing(arg_id)
10-
arg = get(ENV, "GROUP", "ALL")
11-
# For some reason `ENV["GROUP"]` is set to `""`
12-
# when running via GitHub Actions, so handle that case:
13-
arg == "" ? "ALL" : arg
14-
else
15-
only(match(pat, ARGS[arg_id]).captures)
16-
end
17-
)
18-
19-
"""
20-
match files of the form `test_*.jl`, but exclude `*setup*.jl`
21-
"""
22-
function istestfile(path)
23-
fn = basename(path)
24-
return endswith(fn, ".jl") && startswith(basename(fn), "test_") &&
25-
!contains(fn, "setup")
26-
end
27-
"""
28-
match files of the form `*.jl`, but exclude `*_notest.jl` and `*setup*.jl`
29-
"""
30-
function isexamplefile(path)
31-
fn = basename(path)
32-
return endswith(fn, ".jl") && !endswith(fn, "_notest.jl") && !contains(fn, "setup")
33-
end
34-
35-
@time begin
36-
# tests in groups based on folder structure
37-
for testgroup in filter(isdir, readdir(@__DIR__; join = true))
38-
if GROUP == "ALL" || GROUP == uppercase(basename(testgroup))
39-
for filename in filter(istestfile, readdir(testgroup; join = true))
40-
@eval @safetestset $(basename(filename)) begin
41-
include($filename)
42-
end
43-
end
44-
end
45-
end
46-
47-
# single files in top folder
48-
for file in filter(istestfile, readdir(@__DIR__; join = true))
49-
(basename(file) == basename(@__FILE__)) && continue # exclude this file to avoid infinite recursion
50-
@eval @safetestset $(basename(file)) begin
51-
include($file)
52-
end
53-
end
54-
55-
# test examples
56-
examplepath = joinpath(@__DIR__, "..", "examples")
57-
for (root, _, files) in walkdir(examplepath)
58-
contains(chopprefix(root, @__DIR__), "setup") && continue
59-
for file in filter(isexamplefile, files)
60-
filename = joinpath(root, file)
61-
@eval begin
62-
@safetestset $file begin
63-
$(
64-
Expr(
65-
:macrocall,
66-
GlobalRef(Suppressor, Symbol("@suppress")),
67-
LineNumberNode(@__LINE__, @__FILE__),
68-
:(include($filename))
69-
)
70-
)
71-
end
72-
end
73-
end
74-
end
75-
end
3+
ITensorPkgSkeleton.runtests(; testdir = @__DIR__)

0 commit comments

Comments
 (0)