From e21a1a1e7ee743c09e949277d9225c9f3d0dd0a0 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Mon, 2 Dec 2024 09:34:48 -0500 Subject: [PATCH 1/7] update installation instructions in README --- README.md | 11 +++++++++-- examples/README.jl | 13 +++++++++++-- 2 files changed, 20 insertions(+), 4 deletions(-) diff --git a/README.md b/README.md index 7dcb306..7981179 100644 --- a/README.md +++ b/README.md @@ -11,10 +11,17 @@ A module defining a set of basic types which are place holders for allocated bit ## Installation instructions +This package currently resides in the `ITensor/ITensorRegistry` local registry. +In order to install, simply add that registry through your package manager. +This step is only required once. ```julia -julia> using Pkg: Pkg +julia> using Pkg: Pkg; +julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry.jl") +``` +Then, the package can be added as usual through the package manager: -julia> Pkg.add(url="https://github.com/ITensor/UnspecifiedTypes.jl") +```julia +julia> Pkg.add("UnspecifiedTypes") ``` ## Examples diff --git a/examples/README.jl b/examples/README.jl index 0eda9b8..905a7ca 100644 --- a/examples/README.jl +++ b/examples/README.jl @@ -11,11 +11,20 @@ # ## Installation instructions +# This package currently resides in the `ITensor/ITensorRegistry` local registry. +# In order to install, simply add that registry through your package manager. +# This step is only required once. #= ```julia -julia> using Pkg: Pkg +julia> using Pkg: Pkg; +julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry.jl") +``` +=# +# Then, the package can be added as usual through the package manager: -julia> Pkg.add(url="https://github.com/ITensor/UnspecifiedTypes.jl") +#= +```julia +julia> Pkg.add("UnspecifiedTypes") ``` =# From 38b3b29965572a0ab6f285a22c76aed0129cfbf4 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 10:46:08 -0500 Subject: [PATCH 2/7] Updates from skeleton --- .github/workflows/Documentation.yml | 22 +++++++++++++++ .github/workflows/FormatCheck.yml | 36 +++++-------------------- .github/workflows/LiterateCheck.yml | 40 ++++++--------------------- .github/workflows/Tests.yml | 42 +++++++++++++++++++++++++++++ README.md | 10 ++++--- examples/README.jl | 7 ++--- 6 files changed, 90 insertions(+), 67 deletions(-) create mode 100644 .github/workflows/Documentation.yml create mode 100644 .github/workflows/Tests.yml diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml new file mode 100644 index 0000000..75c7be5 --- /dev/null +++ b/.github/workflows/Documentation.yml @@ -0,0 +1,22 @@ +name: "Documentation" + +on: + push: + branches: + - main + tags: '*' + pull_request: + schedule: + - cron: '1 4 * * 4' + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + cancel-in-progress: ${{ github.ref_name != github.event.repository.default_branch || github.ref != 'refs/tags/v*' }} + +jobs: + build-and-deploy-docs: + name: "Documentation" + uses: "ITensor/ITensorActions/.github/workflows/Documentation.yml@main" + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git + secrets: "inherit" diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index bb6d933..3f78afc 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,35 +1,13 @@ -name: Format check +name: "Format Check" + on: push: - branches: [main] - tags: [v*] + branches: + - 'main' + tags: '*' pull_request: jobs: - format: + format-check: name: "Format Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - - name: Install JuliaFormatter and format - run: | - julia -e 'using Pkg; Pkg.add(PackageSpec(name="JuliaFormatter"))' - julia -e 'using JuliaFormatter; format(".", verbose=true)' - - name: Check format - run: | - julia -e ' - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "The following files have not been formatted:" - write(stdout, out) - out_diff = Cmd(`git diff`) |> read |> String - @error "Diff:" - write(stdout, out_diff) - exit(1) - @error "" - end' + uses: "ITensor/ITensorActions/.github/workflows/FormatCheck.yml@main" diff --git a/.github/workflows/LiterateCheck.yml b/.github/workflows/LiterateCheck.yml index ade2453..2ca5f27 100644 --- a/.github/workflows/LiterateCheck.yml +++ b/.github/workflows/LiterateCheck.yml @@ -1,39 +1,15 @@ -name: Literate check +name: "Literate Check" + on: push: - branches: [main] - tags: [v*] + branches: + - 'main' + tags: '*' pull_request: jobs: literate: name: "Literate Check" - runs-on: ubuntu-latest - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: 1 - - name: Install Literate and generate docs - run: | - julia -e ' - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate() - Pkg.add(PackageSpec(name="Literate"))' - julia -e 'include("docs/make_readme.jl")' - - name: Check if docs need to be updated - run: | - julia -e ' - out = Cmd(`git diff --name-only`) |> read |> String - if out == "" - exit(0) - else - @error "The docs are outdated, rerun Literate to regenerate them." - write(stdout, out) - out_diff = Cmd(`git diff`) |> read |> String - @error "Diff:" - write(stdout, out_diff) - exit(1) - @error "" - end' + uses: "ITensor/ITensorActions/.github/workflows/LiterateCheck.yml@main" + with: + localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml new file mode 100644 index 0000000..5a0a306 --- /dev/null +++ b/.github/workflows/Tests.yml @@ -0,0 +1,42 @@ +name: Tests +on: + push: + branches: + - 'master' + - 'main' + - 'release-' + tags: '*' + paths-ignore: + - 'docs/**' + pull_request: + workflow_dispatch: + +concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + # Cancel intermediate builds: only if it is a pull request build. + cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} + +jobs: + tests: + name: "Tests" + strategy: + fail-fast: false + matrix: + version: + - 'lts' # minimal supported version + - '1' # latest released Julia version + # group: + # - 'core' + # - 'optional' + os: + - ubuntu-latest + - macOS-latest + - windows-latest + uses: "ITensor/ITensorActions/.github/workflows/Tests.yml@main" + with: + group: "${{ matrix.group }}" + julia-version: "${{ matrix.version }}" + os: "${{ matrix.os }}" + localregistry: https://github.com/ITensor/ITensorRegistry.git + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/README.md b/README.md index 7981179..8c26137 100644 --- a/README.md +++ b/README.md @@ -11,15 +11,19 @@ A module defining a set of basic types which are place holders for allocated bit ## Installation instructions -This package currently resides in the `ITensor/ITensorRegistry` local registry. +This package resides in the `ITensor/ITensorRegistry` local registry. In order to install, simply add that registry through your package manager. This step is only required once. + ```julia -julia> using Pkg: Pkg; -julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry.jl") +julia> using Pkg: Pkg + +julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") ``` + Then, the package can be added as usual through the package manager: + ```julia julia> Pkg.add("UnspecifiedTypes") ``` diff --git a/examples/README.jl b/examples/README.jl index 905a7ca..3045804 100644 --- a/examples/README.jl +++ b/examples/README.jl @@ -11,13 +11,14 @@ # ## Installation instructions -# This package currently resides in the `ITensor/ITensorRegistry` local registry. +# This package resides in the `ITensor/ITensorRegistry` local registry. # In order to install, simply add that registry through your package manager. # This step is only required once. #= ```julia -julia> using Pkg: Pkg; -julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry.jl") +julia> using Pkg: Pkg + +julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") ``` =# # Then, the package can be added as usual through the package manager: From c4816eab8a4796213d3641a59cf77c0d3ed0af24 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 11:35:45 -0500 Subject: [PATCH 3/7] add whitespace to retrigger tests --- test/runtests.jl | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index 41f64ac..d96041a 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,11 +2,12 @@ using Test: @testset @testset "UnspecifiedTypes.jl" begin - filenames = filter(readdir(@__DIR__)) do f - startswith("test_")(f) && endswith(".jl")(f) - end - @testset "Test $filename" for filename in filenames - include(filename) - end + filenames = filter(readdir(@__DIR__)) do f + startswith("test_")(f) && endswith(".jl")(f) + end + @testset "Test $filename" for filename in filenames + include(filename) + end end + end From c158282d82ee1ccde26da770ec00c513e1f434c9 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 11:40:09 -0500 Subject: [PATCH 4/7] formatter (to retrigger actions (again)) --- test/runtests.jl | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/test/runtests.jl b/test/runtests.jl index d96041a..524caf4 100644 --- a/test/runtests.jl +++ b/test/runtests.jl @@ -2,12 +2,12 @@ using Test: @testset @testset "UnspecifiedTypes.jl" begin - filenames = filter(readdir(@__DIR__)) do f - startswith("test_")(f) && endswith(".jl")(f) - end - @testset "Test $filename" for filename in filenames - include(filename) - end + filenames = filter(readdir(@__DIR__)) do f + startswith("test_")(f) && endswith(".jl")(f) + end + @testset "Test $filename" for filename in filenames + include(filename) + end end end From da85c5db51810a0409ded816b3d6bff3898f7789 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 11:56:36 -0500 Subject: [PATCH 5/7] update readme to be compatible --- README.md | 3 --- 1 file changed, 3 deletions(-) diff --git a/README.md b/README.md index 8c26137..269ec00 100644 --- a/README.md +++ b/README.md @@ -14,16 +14,13 @@ A module defining a set of basic types which are place holders for allocated bit This package resides in the `ITensor/ITensorRegistry` local registry. In order to install, simply add that registry through your package manager. This step is only required once. - ```julia julia> using Pkg: Pkg julia> Pkg.Registry.add(url="https://github.com/ITensor/ITensorRegistry") ``` - Then, the package can be added as usual through the package manager: - ```julia julia> Pkg.add("UnspecifiedTypes") ``` From 1dcd436b6c523d300aa9b5137cd6e1a4d7cf8c02 Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 17:26:19 -0500 Subject: [PATCH 6/7] remove old tests --- .github/workflows/CI.yml | 79 ---------------------------------------- 1 file changed, 79 deletions(-) delete mode 100644 .github/workflows/CI.yml diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml deleted file mode 100644 index de7ff5a..0000000 --- a/.github/workflows/CI.yml +++ /dev/null @@ -1,79 +0,0 @@ -name: CI -on: - push: - branches: - - main - tags: ['*'] - pull_request: - workflow_dispatch: -concurrency: - # Skip intermediate builds: always. - # Cancel intermediate builds: only if it is a pull request build. - group: ${{ github.workflow }}-${{ github.ref }} - cancel-in-progress: ${{ startsWith(github.ref, 'refs/pull/') }} -jobs: - test: - name: Julia ${{ matrix.version }} - ${{ matrix.os }} - ${{ matrix.arch }} - runs-on: ${{ matrix.os }} - timeout-minutes: 60 - permissions: # needed to allow julia-actions/cache to proactively delete old caches that it has created - actions: write - contents: read - strategy: - fail-fast: false - matrix: - version: - - 'lts' - - '1' - os: - - ubuntu-latest - - macOS-latest - - windows-latest - arch: - - x64 - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: ${{ matrix.version }} - arch: ${{ matrix.arch }} - - uses: julia-actions/cache@v2 - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-runtest@v1 - - uses: julia-actions/julia-processcoverage@v1 - - uses: codecov/codecov-action@v5 - with: - files: lcov.info - token: ${{ secrets.CODECOV_TOKEN }} - fail_ci_if_error: false - docs: - name: Documentation - runs-on: ubuntu-latest - permissions: - actions: write # needed to allow julia-actions/cache to proactively delete old caches that it has created - contents: write - statuses: write - steps: - - uses: actions/checkout@v4 - - uses: julia-actions/setup-julia@v2 - with: - version: '1' - - uses: julia-actions/cache@v2 - - name: Configure doc environment - shell: julia --project=docs --color=yes {0} - run: | - using Pkg - Pkg.develop(PackageSpec(path=pwd())) - Pkg.instantiate() - - uses: julia-actions/julia-buildpkg@v1 - - uses: julia-actions/julia-docdeploy@v1 - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - DOCUMENTER_KEY: ${{ secrets.DOCUMENTER_KEY }} - - name: Run doctests - shell: julia --project=docs --color=yes {0} - run: | - using Documenter: DocMeta, doctest - using UnspecifiedTypes - DocMeta.setdocmeta!(UnspecifiedTypes, :DocTestSetup, :(using UnspecifiedTypes); recursive=true) - doctest(UnspecifiedTypes) From 9dafad6601915af02375120b1c42ee30be8e225f Mon Sep 17 00:00:00 2001 From: Lukas Devos Date: Tue, 3 Dec 2024 17:27:20 -0500 Subject: [PATCH 7/7] update codecov secret --- .github/workflows/Documentation.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 75c7be5..01a7f7a 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -19,4 +19,5 @@ jobs: uses: "ITensor/ITensorActions/.github/workflows/Documentation.yml@main" with: localregistry: https://github.com/ITensor/ITensorRegistry.git - secrets: "inherit" + secrets: + CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }}