diff --git a/.github/dependabot.yml b/.github/dependabot.yml index 700707c..5ace460 100644 --- a/.github/dependabot.yml +++ b/.github/dependabot.yml @@ -1,7 +1,6 @@ -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates version: 2 updates: - package-ecosystem: "github-actions" - directory: "/" # Location of package manifests + directory: "/" schedule: interval: "weekly" diff --git a/.github/workflows/CompatHelper.yml b/.github/workflows/CompatHelper.yml index 0614de9..70f2dc6 100644 --- a/.github/workflows/CompatHelper.yml +++ b/.github/workflows/CompatHelper.yml @@ -1,13 +1,11 @@ name: "CompatHelper" - on: schedule: - - cron: '0 0 * * *' - workflow_dispatch: + - cron: "0 0 * * *" + workflow_dispatch: ~ permissions: - contents: write - pull-requests: write - + contents: "write" + pull-requests: "write" jobs: compat-helper: name: "CompatHelper" diff --git a/.github/workflows/Documentation.yml b/.github/workflows/Documentation.yml index 01a7f7a..c3b11ec 100644 --- a/.github/workflows/Documentation.yml +++ b/.github/workflows/Documentation.yml @@ -1,23 +1,20 @@ name: "Documentation" - on: push: branches: - - main - tags: '*' - pull_request: + - "main" + tags: "*" + pull_request: ~ schedule: - - cron: '1 4 * * 4' - + - 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*' }} - + 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 + localregistry: "https://github.com/ITensor/ITensorRegistry.git" secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" diff --git a/.github/workflows/FormatCheck.yml b/.github/workflows/FormatCheck.yml index 47aa97c..3c290ea 100644 --- a/.github/workflows/FormatCheck.yml +++ b/.github/workflows/FormatCheck.yml @@ -1,18 +1,16 @@ name: "Format Check" - on: pull_request_target: - paths: ['**/*.jl'] - types: [opened, synchronize, reopened, ready_for_review] - + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" permissions: - contents: read - actions: write - pull-requests: write - + contents: "read" + actions: "write" + pull-requests: "write" jobs: format-check: name: "Format Check" uses: "ITensor/ITensorActions/.github/workflows/FormatCheck.yml@main" - with: - directory: benchmark docs examples src test diff --git a/.github/workflows/FormatPullRequest.yml b/.github/workflows/FormatPullRequest.yml index db04dc8..b9a329c 100644 --- a/.github/workflows/FormatPullRequest.yml +++ b/.github/workflows/FormatPullRequest.yml @@ -1,16 +1,12 @@ name: "Format Pull Request" - on: schedule: - - cron: '0 0 * * *' - workflow_dispatch: + - cron: "0 0 * * *" + workflow_dispatch: ~ permissions: - contents: write - pull-requests: write - + contents: "write" + pull-requests: "write" jobs: format-pull-request: name: "Format Pull Request" uses: "ITensor/ITensorActions/.github/workflows/FormatPullRequest.yml@main" - with: - directory: benchmark docs examples src test diff --git a/.github/workflows/IntegrationTest.yml b/.github/workflows/IntegrationTest.yml new file mode 100644 index 0000000..d9071c2 --- /dev/null +++ b/.github/workflows/IntegrationTest.yml @@ -0,0 +1,39 @@ +name: "IntegrationTest" +on: + push: + branches: + - "main" + tags: "*" + paths: + - "Project.toml" + pull_request: + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" + - "converted_to_draft" + paths: + - "Project.toml" +jobs: + integration-test: + name: "IntegrationTest" + strategy: + matrix: + pkg: + - "__none__" + uses: "ITensor/ITensorActions/.github/workflows/IntegrationTest.yml@main" + with: + localregistry: "https://github.com/ITensor/ITensorRegistry.git" + pkg: "${{ matrix.pkg }}" + integration-gate: + name: "IntegrationTest" + needs: "integration-test" + if: "${{ always() }}" + runs-on: "ubuntu-latest" + steps: + - name: "Fail if any downstream integration test failed" + run: | + echo "integration-test.result = ${{ needs.integration-test.result }}" + test "${{ needs.integration-test.result }}" = "success" + diff --git a/.github/workflows/IntegrationTestRequest.yml b/.github/workflows/IntegrationTestRequest.yml index 50638b2..6f58e45 100644 --- a/.github/workflows/IntegrationTestRequest.yml +++ b/.github/workflows/IntegrationTestRequest.yml @@ -1,14 +1,14 @@ -name: "Integration Request" - +name: "Integration Test Request" on: issue_comment: - types: [created] - + types: + - "created" jobs: integrationrequest: if: | github.event.issue.pull_request && contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.comment.author_association) - uses: ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main + + uses: "ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main" with: - localregistry: https://github.com/ITensor/ITensorRegistry.git + localregistry: "https://github.com/ITensor/ITensorRegistry.git" diff --git a/.github/workflows/LiterateCheck.yml b/.github/workflows/LiterateCheck.yml deleted file mode 100644 index 2ca5f27..0000000 --- a/.github/workflows/LiterateCheck.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Literate Check" - -on: - push: - branches: - - 'main' - tags: '*' - pull_request: - -jobs: - literate: - name: "Literate Check" - uses: "ITensor/ITensorActions/.github/workflows/LiterateCheck.yml@main" - with: - localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/.github/workflows/Registrator.yml b/.github/workflows/Registrator.yml index 7d6694f..00bf06c 100644 --- a/.github/workflows/Registrator.yml +++ b/.github/workflows/Registrator.yml @@ -1,22 +1,19 @@ -name: Register Package - +name: "Register Package" on: - workflow_dispatch: + workflow_dispatch: ~ push: branches: - - 'master' - - 'main' + - "master" + - "main" paths: - - 'Project.toml' - + - "Project.toml" permissions: - contents: write - pull-requests: write - + contents: "write" + pull-requests: "write" jobs: Register: uses: "ITensor/ITensorActions/.github/workflows/Registrator.yml@main" with: - localregistry: ITensor/ITensorRegistry + localregistry: "ITensor/ITensorRegistry" secrets: - REGISTRATOR_KEY: ${{ secrets.REGISTRATOR_KEY }} + REGISTRATOR_KEY: "${{ secrets.REGISTRATOR_KEY }}" diff --git a/.github/workflows/TagBot.yml b/.github/workflows/TagBot.yml index fa4545c..7876e9c 100644 --- a/.github/workflows/TagBot.yml +++ b/.github/workflows/TagBot.yml @@ -1,18 +1,16 @@ -name: TagBot - +name: "TagBot" on: issue_comment: types: - - created - workflow_dispatch: - + - "created" + workflow_dispatch: ~ jobs: TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest + if: "github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'" + runs-on: "ubuntu-latest" steps: - - uses: JuliaRegistries/TagBot@v1 + - uses: "JuliaRegistries/TagBot@v1" with: - token: ${{ secrets.GITHUB_TOKEN }} - registry: ITensor/ITensorRegistry - ssh: ${{ secrets.DOCUMENTER_KEY }} + token: "${{ secrets.GITHUB_TOKEN }}" + registry: "ITensor/ITensorRegistry" + ssh: "${{ secrets.DOCUMENTER_KEY }}" diff --git a/.github/workflows/Tests.yml b/.github/workflows/Tests.yml index 32beee6..db43292 100644 --- a/.github/workflows/Tests.yml +++ b/.github/workflows/Tests.yml @@ -1,23 +1,24 @@ -name: Tests - +name: "Tests" on: push: branches: - - 'master' - - 'main' - - 'release-' - tags: '*' + - "master" + - "main" + - "release-" + tags: "*" paths-ignore: - - 'docs/**' + - "docs/**" pull_request: - types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] - workflow_dispatch: - + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" + - "converted_to_draft" + 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/') }} - + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}" jobs: tests: name: "Tests" @@ -25,20 +26,28 @@ jobs: fail-fast: false matrix: version: - - 'lts' # minimal supported version - - '1' # latest released Julia version - # group: - # - 'core' - # - 'optional' + - "lts" + - "1" os: - - ubuntu-latest - - macOS-latest - - windows-latest + - "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 + localregistry: "https://github.com/ITensor/ITensorRegistry.git" secrets: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" + tests-gate: + name: "Tests" + needs: "tests" + if: "${{ always() }}" + runs-on: "ubuntu-latest" + steps: + - name: "Fail if any matrix leg failed" + run: | + echo "tests.result = ${{ needs.tests.result }}" + test "${{ needs.tests.result }}" = "success" + diff --git a/.github/workflows/VersionCheck.yml b/.github/workflows/VersionCheck.yml index 69444f1..bb0df88 100644 --- a/.github/workflows/VersionCheck.yml +++ b/.github/workflows/VersionCheck.yml @@ -1,11 +1,9 @@ name: "Version Check" - on: - pull_request: - + pull_request: ~ jobs: version-check: name: "Version Check" uses: "ITensor/ITensorActions/.github/workflows/VersionCheck.yml@main" with: - localregistry: https://github.com/ITensor/ITensorRegistry.git + localregistry: "https://github.com/ITensor/ITensorRegistry.git" diff --git a/.pre-commit-config.yaml b/.pre-commit-config.yaml index 79d6051..9a59a86 100644 --- a/.pre-commit-config.yaml +++ b/.pre-commit-config.yaml @@ -1,20 +1,17 @@ ci: - skip: [itensor-formatter] - + skip: + - "itensor-formatter" repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: check-merge-conflict - - id: check-toml - exclude: (/.*)?templates(/.*)?$ - - id: check-yaml - exclude: (/.*)?templates(/.*)?$ - - id: end-of-file-fixer - exclude_types: [markdown] # incompatible with Literate.jl - -- repo: https://github.com/ITensor/ITensorFormatter.jl - rev: v0.2.11 - hooks: - - id: itensor-formatter - exclude: (/.*)?templates(/.*)?$ + - repo: "https://github.com/pre-commit/pre-commit-hooks" + rev: "v6.0.0" + hooks: + - id: "check-merge-conflict" + - id: "check-toml" + - id: "check-yaml" + - id: "end-of-file-fixer" + exclude_types: + - "markdown" + - repo: "https://github.com/ITensor/ITensorFormatter.jl" + rev: "v0.2.19" + hooks: + - id: "itensor-formatter" diff --git a/Project.toml b/Project.toml index 0c0e4a9..3e74806 100644 --- a/Project.toml +++ b/Project.toml @@ -1,6 +1,6 @@ name = "ITensorPkgSkeleton" uuid = "3d388ab1-018a-49f4-ae50-18094d5f71ea" -version = "0.3.28" +version = "0.3.29" authors = ["ITensor developers and contributors"] [workspace] diff --git a/docs/make_readme.jl b/docs/make_readme.jl index ec242f0..02eed8b 100644 --- a/docs/make_readme.jl +++ b/docs/make_readme.jl @@ -1,21 +1,17 @@ -using ITensorPkgSkeleton: ITensorPkgSkeleton using Literate: Literate -function ccq_logo(content) - include_ccq_logo = """ - - - Flatiron Center for Computational Quantum Physics logo. - - """ - content = replace(content, "{CCQ_LOGO}" => include_ccq_logo) - return content -end +let inputfile = joinpath(@__DIR__, "..", "examples", "README.jl"), + outputdir = joinpath(@__DIR__, ".."), flavor = Literate.CommonMarkFlavor(), + name = "README" -Literate.markdown( - joinpath(pkgdir(ITensorPkgSkeleton), "examples", "README.jl"), - joinpath(pkgdir(ITensorPkgSkeleton)); - flavor = Literate.CommonMarkFlavor(), - name = "README", - postprocess = ccq_logo -) + function postprocess(content) + include_ccq_logo = """ + + + Flatiron Center for Computational Quantum Physics logo. + + """ + return replace(content, "{CCQ_LOGO}" => include_ccq_logo) + end + Literate.markdown(inputfile, outputdir; flavor, name, postprocess) +end diff --git a/src/ITensorPkgSkeleton.jl b/src/ITensorPkgSkeleton.jl index 089d3e9..409df3f 100644 --- a/src/ITensorPkgSkeleton.jl +++ b/src/ITensorPkgSkeleton.jl @@ -84,14 +84,6 @@ function default_user_replacements() ) end -# See: -# https://discourse.julialang.org/t/remove-a-field-from-a-namedtuple/34664 -# https://github.com/JuliaLang/julia/pull/55270 -# https://github.com/JuliaLang/julia/issues/34772 -function delete(nt::NamedTuple{names}, key::Symbol) where {names} - return NamedTuple{filter(≠(key), names)}(nt) -end - #= This processes inputs like: ```julia @@ -99,18 +91,13 @@ ITensorPkgSkeleton.generate("NewPkg"; downstreampkgs=["ITensors"]) ``` =# function format_downstreampkgs(user_replacements) - if !haskey(user_replacements, :downstreampkgs) - return user_replacements - end - if isempty(user_replacements.downstreampkgs) - return delete(user_replacements, :downstreampkgs) - end - downstreampkgs = "" - for pkg in user_replacements.downstreampkgs - downstreampkgs *= " - \'$(pkg)\'\n" + pkgs = + haskey(user_replacements, :downstreampkgs) ? user_replacements.downstreampkgs : [] + if isempty(pkgs) + downstreampkgs = " - \"__none__\"" + else + downstreampkgs = join([" - \"$(pkg)\"" for pkg in pkgs], "\n") end - # Remove extraneous trailing newline character. - downstreampkgs = chop(downstreampkgs) return merge(user_replacements, (; downstreampkgs)) end @@ -119,6 +106,26 @@ function set_default_template_path(template) return joinpath(pkgdir(ITensorPkgSkeleton), "templates", template) end +const TEMPLATE_EXT = ".template" + +function prepare_template(template_dir) + tmp_dir = mktempdir() + for (root, dirs, files) in walkdir(template_dir) + for dir in dirs + mkpath(joinpath(tmp_dir, relpath(joinpath(root, dir), template_dir))) + end + for file in files + src = joinpath(root, file) + rel = relpath(src, template_dir) + if endswith(rel, TEMPLATE_EXT) + rel = rel[1:(end - length(TEMPLATE_EXT))] + end + cp(src, joinpath(tmp_dir, rel)) + end + end + return tmp_dir +end + function is_git_repo(path) return try LibGit2.GitRepo(path) @@ -222,7 +229,7 @@ julia> ITensorPkgSkeleton.generate( - `path::AbstractString`: Path where the package will be generated. Defaults to the [development directory](https://pkgdocs.julialang.org/v1/api/#Pkg.develop), i.e. `$(default_path())`. - `templates`: A list of templates to use. Select a subset of `ITensorPkgSkeleton.all_templates() = $(all_templates())`. Defaults to `ITensorPkgSkeleton.default_templates() = $(default_templates())`. - `ignore_templates`: A list of templates to ignore. This is the same as setting `templates=setdiff(templates, ignore_templates)`. # Process downstream package information. - - `downstreampkgs`: Specify the downstream packages that depend on this package. Setting this will create a workflow where the downstream tests will be run alongside the tests for this package in Github Actions to ensure that changes to your package don't break the specified downstream packages. Defaults to an empty list. + - `downstreampkgs`: Specify the downstream packages that depend on this package. This populates the `IntegrationTest.yml` matrix in the `github` template. If empty, the workflow defaults to `__none__`. - `uuid`: Replaces `{UUID}` in the template. Defaults to the existing UUID in the `Project.toml` if the path points to an existing package, otherwise generates one randomly with `UUIDs.uuid4()`. - `year`: Replaces `{YEAR}` in the template. Year the package/repository was created. Defaults to the current year. # Check if there are downstream tests. """ @@ -235,15 +242,10 @@ function generate( # Process downstream package information. user_replacements = format_downstreampkgs(user_replacements) templates = setdiff(templates, ignore_templates) - # Check if there are downstream tests. - if haskey(user_replacements, :downstreampkgs) && - !isempty(user_replacements.downstreampkgs) - templates = [templates; ["downstreampkgs"]] - else - templates = setdiff(templates, ["downstreampkgs"]) - end # Fill in default path if missing. templates = set_default_template_path.(templates) + # Copy templates to temp directories, stripping `.template` extension from filenames. + templates = prepare_template.(templates) is_new_repo = !is_git_repo(pkgpath) branch_name = default_branch_name() user_replacements_pkgskeleton = to_pkgskeleton(user_replacements) diff --git a/templates/benchmark/benchmark/benchmarks.jl b/templates/benchmark/benchmark/benchmarks.jl.template similarity index 100% rename from templates/benchmark/benchmark/benchmarks.jl rename to templates/benchmark/benchmark/benchmarks.jl.template diff --git a/templates/docs/README.md b/templates/docs/README.md.template similarity index 99% rename from templates/docs/README.md rename to templates/docs/README.md.template index 5a6dd93..a7baa85 100644 --- a/templates/docs/README.md +++ b/templates/docs/README.md.template @@ -50,4 +50,3 @@ Examples go here. --- *This page was generated using [Literate.jl](https://github.com/fredrikekre/Literate.jl).* - diff --git a/templates/docs/docs/Project.toml b/templates/docs/docs/Project.toml.template similarity index 100% rename from templates/docs/docs/Project.toml rename to templates/docs/docs/Project.toml.template index 5d061b5..e637677 100644 --- a/templates/docs/docs/Project.toml +++ b/templates/docs/docs/Project.toml.template @@ -1,12 +1,12 @@ [deps] Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4" -Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" {PKGNAME} = "{UUID}" +Literate = "98b081ad-f1c9-55d3-8b20-4c87d4299306" [sources] {PKGNAME} = {path = ".."} [compat] Documenter = "1" -Literate = "2" {PKGNAME} = "0.1" +Literate = "2" diff --git a/templates/docs/docs/make.jl b/templates/docs/docs/make.jl.template similarity index 96% rename from templates/docs/docs/make.jl rename to templates/docs/docs/make.jl.template index 0193dc4..7397afd 100644 --- a/templates/docs/docs/make.jl +++ b/templates/docs/docs/make.jl.template @@ -20,5 +20,6 @@ makedocs(; ) deploydocs(; - repo = "github.com/ITensor/{PKGNAME}.jl", devbranch = "main", push_preview = true + repo = "github.com/ITensor/{PKGNAME}.jl", devbranch = "main", + push_preview = true ) diff --git a/templates/docs/docs/make_index.jl b/templates/docs/docs/make_index.jl.template similarity index 100% rename from templates/docs/docs/make_index.jl rename to templates/docs/docs/make_index.jl.template index 2bb251f..370496e 100644 --- a/templates/docs/docs/make_index.jl +++ b/templates/docs/docs/make_index.jl.template @@ -1,5 +1,5 @@ -using Literate: Literate using {PKGNAME}: {PKGNAME} +using Literate: Literate function ccq_logo(content) include_ccq_logo = """ diff --git a/templates/docs/docs/make_readme.jl b/templates/docs/docs/make_readme.jl deleted file mode 100644 index f7e2969..0000000 --- a/templates/docs/docs/make_readme.jl +++ /dev/null @@ -1,21 +0,0 @@ -using Literate: Literate -using {PKGNAME}: {PKGNAME} - -function ccq_logo(content) - include_ccq_logo = """ - - - Flatiron Center for Computational Quantum Physics logo. - - """ - content = replace(content, "{CCQ_LOGO}" => include_ccq_logo) - return content -end - -Literate.markdown( - joinpath(pkgdir({PKGNAME}), "examples", "README.jl"), - joinpath(pkgdir({PKGNAME})); - flavor = Literate.CommonMarkFlavor(), - name = "README", - postprocess = ccq_logo -) diff --git a/templates/docs/docs/make_readme.jl.template b/templates/docs/docs/make_readme.jl.template new file mode 100644 index 0000000..02eed8b --- /dev/null +++ b/templates/docs/docs/make_readme.jl.template @@ -0,0 +1,17 @@ +using Literate: Literate + +let inputfile = joinpath(@__DIR__, "..", "examples", "README.jl"), + outputdir = joinpath(@__DIR__, ".."), flavor = Literate.CommonMarkFlavor(), + name = "README" + + function postprocess(content) + include_ccq_logo = """ + + + Flatiron Center for Computational Quantum Physics logo. + + """ + return replace(content, "{CCQ_LOGO}" => include_ccq_logo) + end + Literate.markdown(inputfile, outputdir; flavor, name, postprocess) +end diff --git a/templates/docs/docs/src/assets/CCQ-dark.png b/templates/docs/docs/src/assets/CCQ-dark.png.template similarity index 100% rename from templates/docs/docs/src/assets/CCQ-dark.png rename to templates/docs/docs/src/assets/CCQ-dark.png.template diff --git a/templates/docs/docs/src/assets/CCQ.png b/templates/docs/docs/src/assets/CCQ.png.template similarity index 100% rename from templates/docs/docs/src/assets/CCQ.png rename to templates/docs/docs/src/assets/CCQ.png.template diff --git a/templates/docs/docs/src/assets/extras.css b/templates/docs/docs/src/assets/extras.css.template similarity index 100% rename from templates/docs/docs/src/assets/extras.css rename to templates/docs/docs/src/assets/extras.css.template diff --git a/templates/docs/docs/src/assets/favicon.ico b/templates/docs/docs/src/assets/favicon.ico.template similarity index 100% rename from templates/docs/docs/src/assets/favicon.ico rename to templates/docs/docs/src/assets/favicon.ico.template diff --git a/templates/docs/docs/src/assets/logo-dark.png b/templates/docs/docs/src/assets/logo-dark.png.template similarity index 100% rename from templates/docs/docs/src/assets/logo-dark.png rename to templates/docs/docs/src/assets/logo-dark.png.template diff --git a/templates/docs/docs/src/assets/logo.png b/templates/docs/docs/src/assets/logo.png.template similarity index 100% rename from templates/docs/docs/src/assets/logo.png rename to templates/docs/docs/src/assets/logo.png.template diff --git a/templates/docs/docs/src/reference.md b/templates/docs/docs/src/reference.md.template similarity index 100% rename from templates/docs/docs/src/reference.md rename to templates/docs/docs/src/reference.md.template diff --git a/templates/downstreampkgs/.github/workflows/IntegrationTest.yml b/templates/downstreampkgs/.github/workflows/IntegrationTest.yml deleted file mode 100644 index 6009d93..0000000 --- a/templates/downstreampkgs/.github/workflows/IntegrationTest.yml +++ /dev/null @@ -1,25 +0,0 @@ -name: "IntegrationTest" - -on: - push: - branches: - - 'main' - tags: '*' - paths: - - 'Project.toml' - pull_request: - types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] - paths: - - 'Project.toml' - -jobs: - integration-test: - name: "IntegrationTest" - strategy: - matrix: - pkg: -{DOWNSTREAMPKGS} - uses: "ITensor/ITensorActions/.github/workflows/IntegrationTest.yml@main" - with: - localregistry: "https://github.com/ITensor/ITensorRegistry.git" - pkg: "${{ matrix.pkg }}" diff --git a/templates/examples/examples/Project.toml b/templates/examples/examples/Project.toml.template similarity index 100% rename from templates/examples/examples/Project.toml rename to templates/examples/examples/Project.toml.template diff --git a/templates/examples/examples/README.jl b/templates/examples/examples/README.jl.template similarity index 100% rename from templates/examples/examples/README.jl rename to templates/examples/examples/README.jl.template diff --git a/templates/github/.github/ISSUE_TEMPLATE/BUG_REPORT.md b/templates/github/.github/ISSUE_TEMPLATE/BUG_REPORT.md.template similarity index 100% rename from templates/github/.github/ISSUE_TEMPLATE/BUG_REPORT.md rename to templates/github/.github/ISSUE_TEMPLATE/BUG_REPORT.md.template diff --git a/templates/github/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md b/templates/github/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md.template similarity index 100% rename from templates/github/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md rename to templates/github/.github/ISSUE_TEMPLATE/FEATURE_REQUEST.md.template diff --git a/templates/github/.github/PULL_REQUEST_TEMPLATE.md b/templates/github/.github/PULL_REQUEST_TEMPLATE.md.template similarity index 100% rename from templates/github/.github/PULL_REQUEST_TEMPLATE.md rename to templates/github/.github/PULL_REQUEST_TEMPLATE.md.template diff --git a/templates/github/.github/dependabot.yml b/templates/github/.github/dependabot.yml deleted file mode 100644 index 700707c..0000000 --- a/templates/github/.github/dependabot.yml +++ /dev/null @@ -1,7 +0,0 @@ -# https://docs.github.com/github/administering-a-repository/configuration-options-for-dependency-updates -version: 2 -updates: - - package-ecosystem: "github-actions" - directory: "/" # Location of package manifests - schedule: - interval: "weekly" diff --git a/templates/github/.github/dependabot.yml.template b/templates/github/.github/dependabot.yml.template new file mode 100644 index 0000000..5ace460 --- /dev/null +++ b/templates/github/.github/dependabot.yml.template @@ -0,0 +1,6 @@ +version: 2 +updates: + - package-ecosystem: "github-actions" + directory: "/" + schedule: + interval: "weekly" diff --git a/templates/github/.github/workflows/CompatHelper.yml b/templates/github/.github/workflows/CompatHelper.yml.template similarity index 73% rename from templates/github/.github/workflows/CompatHelper.yml rename to templates/github/.github/workflows/CompatHelper.yml.template index 0614de9..70f2dc6 100644 --- a/templates/github/.github/workflows/CompatHelper.yml +++ b/templates/github/.github/workflows/CompatHelper.yml.template @@ -1,13 +1,11 @@ name: "CompatHelper" - on: schedule: - - cron: '0 0 * * *' - workflow_dispatch: + - cron: "0 0 * * *" + workflow_dispatch: ~ permissions: - contents: write - pull-requests: write - + contents: "write" + pull-requests: "write" jobs: compat-helper: name: "CompatHelper" diff --git a/templates/github/.github/workflows/Documentation.yml b/templates/github/.github/workflows/Documentation.yml deleted file mode 100644 index 01a7f7a..0000000 --- a/templates/github/.github/workflows/Documentation.yml +++ /dev/null @@ -1,23 +0,0 @@ -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: - CODECOV_TOKEN: ${{ secrets.CODECOV_TOKEN }} diff --git a/templates/github/.github/workflows/Documentation.yml.template b/templates/github/.github/workflows/Documentation.yml.template new file mode 100644 index 0000000..c3b11ec --- /dev/null +++ b/templates/github/.github/workflows/Documentation.yml.template @@ -0,0 +1,20 @@ +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: + CODECOV_TOKEN: "${{ secrets.CODECOV_TOKEN }}" diff --git a/templates/github/.github/workflows/FormatCheck.yml b/templates/github/.github/workflows/FormatCheck.yml.template similarity index 53% rename from templates/github/.github/workflows/FormatCheck.yml rename to templates/github/.github/workflows/FormatCheck.yml.template index 1525861..3c290ea 100644 --- a/templates/github/.github/workflows/FormatCheck.yml +++ b/templates/github/.github/workflows/FormatCheck.yml.template @@ -1,15 +1,15 @@ name: "Format Check" - on: pull_request_target: - paths: ['**/*.jl'] - types: [opened, synchronize, reopened, ready_for_review] - + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" permissions: - contents: read - actions: write - pull-requests: write - + contents: "read" + actions: "write" + pull-requests: "write" jobs: format-check: name: "Format Check" diff --git a/templates/github/.github/workflows/FormatPullRequest.yml b/templates/github/.github/workflows/FormatPullRequest.yml.template similarity index 68% rename from templates/github/.github/workflows/FormatPullRequest.yml rename to templates/github/.github/workflows/FormatPullRequest.yml.template index 93875cc..b9a329c 100644 --- a/templates/github/.github/workflows/FormatPullRequest.yml +++ b/templates/github/.github/workflows/FormatPullRequest.yml.template @@ -1,13 +1,11 @@ name: "Format Pull Request" - on: schedule: - - cron: '0 0 * * *' - workflow_dispatch: + - cron: "0 0 * * *" + workflow_dispatch: ~ permissions: - contents: write - pull-requests: write - + contents: "write" + pull-requests: "write" jobs: format-pull-request: name: "Format Pull Request" diff --git a/templates/github/.github/workflows/IntegrationTest.yml.template b/templates/github/.github/workflows/IntegrationTest.yml.template new file mode 100644 index 0000000..01be39b --- /dev/null +++ b/templates/github/.github/workflows/IntegrationTest.yml.template @@ -0,0 +1,39 @@ +name: "IntegrationTest" +on: + push: + branches: + - "main" + tags: "*" + paths: + - "Project.toml" + pull_request: + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" + - "converted_to_draft" + paths: + - "Project.toml" +jobs: + integration-test: + name: "IntegrationTest" + strategy: + matrix: + pkg: +{DOWNSTREAMPKGS} + uses: "ITensor/ITensorActions/.github/workflows/IntegrationTest.yml@main" + with: + localregistry: "https://github.com/ITensor/ITensorRegistry.git" + pkg: "${{ matrix.pkg }}" + integration-gate: + name: "IntegrationTest" + needs: "integration-test" + if: "${{ always() }}" + runs-on: "ubuntu-latest" + steps: + - name: "Fail if any downstream integration test failed" + run: | + echo "integration-test.result = ${{ needs.integration-test.result }}" + test "${{ needs.integration-test.result }}" = "success" + diff --git a/templates/github/.github/workflows/IntegrationTestRequest.yml b/templates/github/.github/workflows/IntegrationTestRequest.yml.template similarity index 56% rename from templates/github/.github/workflows/IntegrationTestRequest.yml rename to templates/github/.github/workflows/IntegrationTestRequest.yml.template index d42fcca..6f58e45 100644 --- a/templates/github/.github/workflows/IntegrationTestRequest.yml +++ b/templates/github/.github/workflows/IntegrationTestRequest.yml.template @@ -1,14 +1,14 @@ name: "Integration Test Request" - on: issue_comment: - types: [created] - + types: + - "created" jobs: integrationrequest: if: | github.event.issue.pull_request && contains(fromJSON('["OWNER", "COLLABORATOR", "MEMBER"]'), github.event.comment.author_association) - uses: ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main + + uses: "ITensor/ITensorActions/.github/workflows/IntegrationTestRequest.yml@main" with: - localregistry: https://github.com/ITensor/ITensorRegistry.git + localregistry: "https://github.com/ITensor/ITensorRegistry.git" diff --git a/templates/github/.github/workflows/LiterateCheck.yml b/templates/github/.github/workflows/LiterateCheck.yml deleted file mode 100644 index 2ca5f27..0000000 --- a/templates/github/.github/workflows/LiterateCheck.yml +++ /dev/null @@ -1,15 +0,0 @@ -name: "Literate Check" - -on: - push: - branches: - - 'main' - tags: '*' - pull_request: - -jobs: - literate: - name: "Literate Check" - uses: "ITensor/ITensorActions/.github/workflows/LiterateCheck.yml@main" - with: - localregistry: https://github.com/ITensor/ITensorRegistry.git diff --git a/templates/github/.github/workflows/Registrator.yml b/templates/github/.github/workflows/Registrator.yml deleted file mode 100644 index 7d6694f..0000000 --- a/templates/github/.github/workflows/Registrator.yml +++ /dev/null @@ -1,22 +0,0 @@ -name: Register Package - -on: - workflow_dispatch: - push: - branches: - - 'master' - - 'main' - paths: - - 'Project.toml' - -permissions: - contents: write - pull-requests: write - -jobs: - Register: - uses: "ITensor/ITensorActions/.github/workflows/Registrator.yml@main" - with: - localregistry: ITensor/ITensorRegistry - secrets: - REGISTRATOR_KEY: ${{ secrets.REGISTRATOR_KEY }} diff --git a/templates/github/.github/workflows/Registrator.yml.template b/templates/github/.github/workflows/Registrator.yml.template new file mode 100644 index 0000000..00bf06c --- /dev/null +++ b/templates/github/.github/workflows/Registrator.yml.template @@ -0,0 +1,19 @@ +name: "Register Package" +on: + workflow_dispatch: ~ + push: + branches: + - "master" + - "main" + paths: + - "Project.toml" +permissions: + contents: "write" + pull-requests: "write" +jobs: + Register: + uses: "ITensor/ITensorActions/.github/workflows/Registrator.yml@main" + with: + localregistry: "ITensor/ITensorRegistry" + secrets: + REGISTRATOR_KEY: "${{ secrets.REGISTRATOR_KEY }}" diff --git a/templates/github/.github/workflows/TagBot.yml b/templates/github/.github/workflows/TagBot.yml deleted file mode 100644 index fa4545c..0000000 --- a/templates/github/.github/workflows/TagBot.yml +++ /dev/null @@ -1,18 +0,0 @@ -name: TagBot - -on: - issue_comment: - types: - - created - workflow_dispatch: - -jobs: - TagBot: - if: github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot' - runs-on: ubuntu-latest - steps: - - uses: JuliaRegistries/TagBot@v1 - with: - token: ${{ secrets.GITHUB_TOKEN }} - registry: ITensor/ITensorRegistry - ssh: ${{ secrets.DOCUMENTER_KEY }} diff --git a/templates/github/.github/workflows/TagBot.yml.template b/templates/github/.github/workflows/TagBot.yml.template new file mode 100644 index 0000000..7876e9c --- /dev/null +++ b/templates/github/.github/workflows/TagBot.yml.template @@ -0,0 +1,16 @@ +name: "TagBot" +on: + issue_comment: + types: + - "created" + workflow_dispatch: ~ +jobs: + TagBot: + if: "github.event_name == 'workflow_dispatch' || github.actor == 'JuliaTagBot'" + runs-on: "ubuntu-latest" + steps: + - uses: "JuliaRegistries/TagBot@v1" + with: + token: "${{ secrets.GITHUB_TOKEN }}" + registry: "ITensor/ITensorRegistry" + ssh: "${{ secrets.DOCUMENTER_KEY }}" diff --git a/templates/github/.github/workflows/Tests.yml b/templates/github/.github/workflows/Tests.yml deleted file mode 100644 index 32beee6..0000000 --- a/templates/github/.github/workflows/Tests.yml +++ /dev/null @@ -1,44 +0,0 @@ -name: Tests - -on: - push: - branches: - - 'master' - - 'main' - - 'release-' - tags: '*' - paths-ignore: - - 'docs/**' - pull_request: - types: [opened, synchronize, reopened, ready_for_review, converted_to_draft] - 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/templates/github/.github/workflows/Tests.yml.template b/templates/github/.github/workflows/Tests.yml.template new file mode 100644 index 0000000..db43292 --- /dev/null +++ b/templates/github/.github/workflows/Tests.yml.template @@ -0,0 +1,53 @@ +name: "Tests" +on: + push: + branches: + - "master" + - "main" + - "release-" + tags: "*" + paths-ignore: + - "docs/**" + pull_request: + types: + - "opened" + - "synchronize" + - "reopened" + - "ready_for_review" + - "converted_to_draft" + workflow_dispatch: ~ +concurrency: + group: "${{ github.workflow }}-${{ github.ref }}" + cancel-in-progress: "${{ startsWith(github.ref, 'refs/pull/') }}" +jobs: + tests: + name: "Tests" + strategy: + fail-fast: false + matrix: + version: + - "lts" + - "1" + 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 }}" + tests-gate: + name: "Tests" + needs: "tests" + if: "${{ always() }}" + runs-on: "ubuntu-latest" + steps: + - name: "Fail if any matrix leg failed" + run: | + echo "tests.result = ${{ needs.tests.result }}" + test "${{ needs.tests.result }}" = "success" + diff --git a/templates/github/.github/workflows/VersionCheck.yml b/templates/github/.github/workflows/VersionCheck.yml.template similarity index 64% rename from templates/github/.github/workflows/VersionCheck.yml rename to templates/github/.github/workflows/VersionCheck.yml.template index 69444f1..bb0df88 100644 --- a/templates/github/.github/workflows/VersionCheck.yml +++ b/templates/github/.github/workflows/VersionCheck.yml.template @@ -1,11 +1,9 @@ name: "Version Check" - on: - pull_request: - + pull_request: ~ jobs: version-check: name: "Version Check" uses: "ITensor/ITensorActions/.github/workflows/VersionCheck.yml@main" with: - localregistry: https://github.com/ITensor/ITensorRegistry.git + localregistry: "https://github.com/ITensor/ITensorRegistry.git" diff --git a/templates/gitignore/.gitignore b/templates/gitignore/.gitignore.template similarity index 100% rename from templates/gitignore/.gitignore rename to templates/gitignore/.gitignore.template diff --git a/templates/license/LICENSE b/templates/license/LICENSE.template similarity index 100% rename from templates/license/LICENSE rename to templates/license/LICENSE.template diff --git a/templates/precommit/.pre-commit-config.yaml b/templates/precommit/.pre-commit-config.yaml deleted file mode 100644 index d3c8686..0000000 --- a/templates/precommit/.pre-commit-config.yaml +++ /dev/null @@ -1,17 +0,0 @@ -ci: - skip: [itensor-formatter] - -repos: -- repo: https://github.com/pre-commit/pre-commit-hooks - rev: v6.0.0 - hooks: - - id: check-merge-conflict - - id: check-toml - - id: check-yaml - - id: end-of-file-fixer - exclude_types: [markdown] # incompatible with Literate.jl - -- repo: https://github.com/ITensor/ITensorFormatter.jl - rev: v0.2.9 - hooks: - - id: itensor-formatter diff --git a/templates/precommit/.pre-commit-config.yaml.template b/templates/precommit/.pre-commit-config.yaml.template new file mode 100644 index 0000000..9a59a86 --- /dev/null +++ b/templates/precommit/.pre-commit-config.yaml.template @@ -0,0 +1,17 @@ +ci: + skip: + - "itensor-formatter" +repos: + - repo: "https://github.com/pre-commit/pre-commit-hooks" + rev: "v6.0.0" + hooks: + - id: "check-merge-conflict" + - id: "check-toml" + - id: "check-yaml" + - id: "end-of-file-fixer" + exclude_types: + - "markdown" + - repo: "https://github.com/ITensor/ITensorFormatter.jl" + rev: "v0.2.19" + hooks: + - id: "itensor-formatter" diff --git a/templates/project/Project.toml b/templates/project/Project.toml.template similarity index 100% rename from templates/project/Project.toml rename to templates/project/Project.toml.template diff --git a/templates/src/src/{PKGNAME}.jl b/templates/src/src/{PKGNAME}.jl deleted file mode 100644 index 72167d5..0000000 --- a/templates/src/src/{PKGNAME}.jl +++ /dev/null @@ -1,5 +0,0 @@ -module {PKGNAME} - -# Write your package code here. - -end diff --git a/templates/src/src/{PKGNAME}.jl.template b/templates/src/src/{PKGNAME}.jl.template new file mode 100644 index 0000000..eb31d5f --- /dev/null +++ b/templates/src/src/{PKGNAME}.jl.template @@ -0,0 +1,3 @@ +module {PKGNAME} + +end diff --git a/templates/test/test/Project.toml b/templates/test/test/Project.toml.template similarity index 95% rename from templates/test/test/Project.toml rename to templates/test/test/Project.toml.template index 5c7ab08..c3dbc03 100644 --- a/templates/test/test/Project.toml +++ b/templates/test/test/Project.toml.template @@ -9,7 +9,7 @@ Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40" {PKGNAME} = {path = ".."} [compat] -Aqua = "0.8" +Aqua = "0.8.9" {PKGNAME} = "0.1" SafeTestsets = "0.1" Suppressor = "0.2" diff --git a/templates/test/test/runtests.jl b/templates/test/test/runtests.jl.template similarity index 100% rename from templates/test/test/runtests.jl rename to templates/test/test/runtests.jl.template diff --git a/templates/test/test/test_aqua.jl b/templates/test/test/test_aqua.jl.template similarity index 100% rename from templates/test/test/test_aqua.jl rename to templates/test/test/test_aqua.jl.template diff --git a/templates/test/test/test_basics.jl b/templates/test/test/test_basics.jl.template similarity index 100% rename from templates/test/test/test_basics.jl rename to templates/test/test/test_basics.jl.template diff --git a/test/basics/test_basics.jl b/test/basics/test_basics.jl deleted file mode 100644 index 592abae..0000000 --- a/test/basics/test_basics.jl +++ /dev/null @@ -1,49 +0,0 @@ -using ITensorPkgSkeleton: ITensorPkgSkeleton -using Test: @test, @testset - -@testset "ITensorPkgSkeleton" begin - pkgdirs = [ - ".github", - ".github/ISSUE_TEMPLATE", - ".github/workflows", - "benchmark", - "docs", - "examples", - "src", - "test", - ] - @testset "generate" begin - path = mktempdir() - ITensorPkgSkeleton.generate("NewPkg"; path) - @test isdir(joinpath(path, "NewPkg")) - @test isfile(joinpath(path, "NewPkg", "Project.toml")) - for dir in pkgdirs - @test isdir(joinpath(path, "NewPkg", dir)) - end - @test !isfile( - joinpath(path, "NewPkg", ".github", "workflows", "IntegrationTest.yml") - ) - end - @testset "generate with downstream tests" begin - for templates in (ITensorPkgSkeleton.default_templates(), []) - for downstreampkgs in (["DownstreamPkg"],) - path = mktempdir() - ITensorPkgSkeleton.generate("NewPkg"; path, templates, downstreampkgs) - @test isdir(joinpath(path, "NewPkg")) - @test isdir(joinpath(path, "NewPkg", ".github", "workflows")) - @test isfile( - joinpath(path, "NewPkg", ".github", "workflows", "IntegrationTest.yml") - ) - @test open( - joinpath(path, "NewPkg", ".github", "workflows", "IntegrationTest.yml"), - "r" - ) do io - return contains(read(io, String), "- 'DownstreamPkg'") - end - for dir in setdiff(pkgdirs, [".github", ".github/workflows"]) - @test isdir(joinpath(path, "NewPkg", dir)) == !isempty(templates) - end - end - end - end -end diff --git a/test/test_basics.jl b/test/test_basics.jl new file mode 100644 index 0000000..05b7010 --- /dev/null +++ b/test/test_basics.jl @@ -0,0 +1,70 @@ +using ITensorPkgSkeleton: ITensorPkgSkeleton +using Test: @test, @testset + +@testset "ITensorPkgSkeleton" begin + pkgdirs = Dict( + ".github" => "github", + ".github/ISSUE_TEMPLATE" => "github", + ".github/workflows" => "github", + "benchmark" => "benchmark", + "docs" => "docs", + "examples" => "examples", + "src" => "src", + "test" => "test" + ) + @testset "generate" begin + path = mktempdir() + ITensorPkgSkeleton.generate("NewPkg"; path) + @test isdir(joinpath(path, "NewPkg")) + @test isfile(joinpath(path, "NewPkg", "Project.toml")) + for (dir, _) in pkgdirs + @test isdir(joinpath(path, "NewPkg", dir)) + end + @test isfile( + joinpath(path, "NewPkg", ".github", "workflows", "IntegrationTest.yml") + ) + @test open( + joinpath(path, "NewPkg", ".github", "workflows", "IntegrationTest.yml"), + "r" + ) do io + return contains(read(io, String), "- \"__none__\"") + end + end + @testset "generate with downstream tests" begin + for templates in (ITensorPkgSkeleton.default_templates(), [], ["github"]) + for downstreampkgs in (["DownstreamPkg"],) + path = mktempdir() + ITensorPkgSkeleton.generate("NewPkg"; path, templates, downstreampkgs) + enabled_templates = Set{String}(String.(templates)) + has_github_template = + templates == ITensorPkgSkeleton.default_templates() || + "github" in templates + @test isdir(joinpath(path, "NewPkg")) + if has_github_template + @test isdir(joinpath(path, "NewPkg", ".github", "workflows")) + @test isfile( + joinpath( + path, "NewPkg", ".github", "workflows", "IntegrationTest.yml" + ) + ) + @test open( + joinpath( + path, "NewPkg", ".github", "workflows", "IntegrationTest.yml" + ), + "r" + ) do io + return contains(read(io, String), "- \"DownstreamPkg\"") + end + else + @test !isdir(joinpath(path, "NewPkg", ".github")) + end + for (dir, template_name) in pkgdirs + expected = + templates == ITensorPkgSkeleton.default_templates() || + template_name in enabled_templates + @test isdir(joinpath(path, "NewPkg", dir)) == expected + end + end + end + end +end